You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2013/02/28 14:53:20 UTC
svn commit: r1451197 [2/4] - in /flex/falcon/trunk:
compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/
compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/
compiler.jx.tests/src/org/apache/flex/compiler/internal/js/c...
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestPackage.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestPackage.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestPackage.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestPackage.java Thu Feb 28 13:53:18 2013
@@ -19,7 +19,7 @@
package org.apache.flex.compiler.internal.as.codegen;
-import org.apache.flex.compiler.test.ASTestBase;
+import org.apache.flex.compiler.internal.test.ASTestBase;
import org.apache.flex.compiler.tree.as.IFileNode;
import org.junit.Ignore;
import org.junit.Test;
@@ -40,7 +40,7 @@ public class TestPackage extends ASTestB
public void testPackage_Simple()
{
IFileNode node = compileAS("package{}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut("package {\n}");
}
@@ -48,7 +48,7 @@ public class TestPackage extends ASTestB
public void testPackage_SimpleName()
{
IFileNode node = compileAS("package foo {}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut("package foo {\n}");
}
@@ -56,7 +56,7 @@ public class TestPackage extends ASTestB
public void testPackage_Name()
{
IFileNode node = compileAS("package foo.bar.baz {}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut("package foo.bar.baz {\n}");
}
@@ -64,7 +64,7 @@ public class TestPackage extends ASTestB
public void testPackageSimple_Class()
{
IFileNode node = compileAS("package {public class A{}}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut("package {\n\tpublic class A {\n\t}\n}");
}
@@ -72,7 +72,7 @@ public class TestPackage extends ASTestB
public void testPackageQualified_Class()
{
IFileNode node = compileAS("package foo.bar.baz {public class A{}}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut("package foo.bar.baz {\n\tpublic class A {\n\t}\n}");
}
@@ -80,7 +80,7 @@ public class TestPackage extends ASTestB
public void testPackageQualified_ClassBody()
{
IFileNode node = compileAS("package foo.bar.baz {public class A{public function A(){}}}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut("package foo.bar.baz {\n\tpublic class A {\n\t\tpublic function A() {\n\t\t}\n\t}\n}");
}
@@ -88,7 +88,7 @@ public class TestPackage extends ASTestB
public void testPackageQualified_ClassBodyMethodContents()
{
IFileNode node = compileAS("package foo.bar.baz {public class A{public function A(){if (a){for each(var i:Object in obj){doit();}}}}}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut("package foo.bar.baz {\n\tpublic class A {\n\t\tpublic function A() {\n\t\t\t"
+ "if (a) {\n\t\t\t\tfor each (var i:Object in obj) {\n\t\t\t\t\tdoit();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}");
}
@@ -99,7 +99,7 @@ public class TestPackage extends ASTestB
{
// TODO (mschmalle) implement Import unit tests for as
IFileNode node = compileAS("package{import foo.bar.Baz;}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut("package {\nimport foo.bar.Baz;}");
}
}
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestStatements.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestStatements.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestStatements.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestStatements.java Thu Feb 28 13:53:18 2013
@@ -19,8 +19,8 @@
package org.apache.flex.compiler.internal.as.codegen;
+import org.apache.flex.compiler.internal.test.ASTestBase;
import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
-import org.apache.flex.compiler.test.ASTestBase;
import org.apache.flex.compiler.tree.as.IFileNode;
import org.apache.flex.compiler.tree.as.IForLoopNode;
import org.apache.flex.compiler.tree.as.IIfNode;
@@ -50,7 +50,7 @@ public class TestStatements extends ASTe
{
IVariableNode node = (IVariableNode) getNode("var a;",
IVariableNode.class);
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("var a:*");
}
@@ -59,7 +59,7 @@ public class TestStatements extends ASTe
{
IVariableNode node = (IVariableNode) getNode("var a:int;",
IVariableNode.class);
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("var a:int");
}
@@ -68,7 +68,7 @@ public class TestStatements extends ASTe
{
IVariableNode node = (IVariableNode) getNode("var a:int = 42;",
IVariableNode.class);
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("var a:int = 42");
}
@@ -77,7 +77,7 @@ public class TestStatements extends ASTe
{
IVariableNode node = (IVariableNode) getNode(
"var a:Foo = new Foo(42, 'goo');", IVariableNode.class);
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("var a:Foo = new Foo(42, 'goo')");
}
@@ -86,7 +86,7 @@ public class TestStatements extends ASTe
{
IVariableNode node = (IVariableNode) getNode(
"var a:int = 4, b:int = 11, c:int = 42;", IVariableNode.class);
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("var a:int = 4, b:int = 11, c:int = 42");
}
@@ -99,7 +99,7 @@ public class TestStatements extends ASTe
{
IVariableNode node = (IVariableNode) getNode("const a = 42;",
IVariableNode.class);
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("const a:* = 42");
}
@@ -108,7 +108,7 @@ public class TestStatements extends ASTe
{
IVariableNode node = (IVariableNode) getNode("const a:int = 42;",
IVariableNode.class);
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("const a:int = 42");
}
@@ -117,7 +117,7 @@ public class TestStatements extends ASTe
{
IVariableNode node = (IVariableNode) getNode(
"const a:int = 4, b:int = 11, c:int = 42;", IVariableNode.class);
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("const a:int = 4, b:int = 11, c:int = 42");
}
@@ -129,7 +129,7 @@ public class TestStatements extends ASTe
public void testVisitIf_1()
{
IIfNode node = (IIfNode) getNode("if (a) b++;", IIfNode.class);
- visitor.visitIf(node);
+ asBlockWalker.visitIf(node);
assertOut("if (a)\n\tb++;");
}
@@ -137,7 +137,7 @@ public class TestStatements extends ASTe
public void testVisitIf_2()
{
IIfNode node = (IIfNode) getNode("if (a) b++; else c++;", IIfNode.class);
- visitor.visitIf(node);
+ asBlockWalker.visitIf(node);
assertOut("if (a)\n\tb++;\nelse\n\tc++;");
}
@@ -146,7 +146,7 @@ public class TestStatements extends ASTe
{
IIfNode node = (IIfNode) getNode(
"if (a) b++; else if (c) d++; else if(e) --f;", IIfNode.class);
- visitor.visitIf(node);
+ asBlockWalker.visitIf(node);
assertOut("if (a)\n\tb++;\nelse if (c)\n\td++;\nelse if (e)\n\t--f;");
}
@@ -158,7 +158,7 @@ public class TestStatements extends ASTe
public void testVisitIf_1a()
{
IIfNode node = (IIfNode) getNode("if (a) { b++; }", IIfNode.class);
- visitor.visitIf(node);
+ asBlockWalker.visitIf(node);
assertOut("if (a) {\n\tb++;\n}");
}
@@ -167,7 +167,7 @@ public class TestStatements extends ASTe
{
IIfNode node = (IIfNode) getNode("if (a) { b++; } else { c++; }",
IIfNode.class);
- visitor.visitIf(node);
+ asBlockWalker.visitIf(node);
assertOut("if (a) {\n\tb++;\n} else {\n\tc++;\n}");
}
@@ -177,7 +177,7 @@ public class TestStatements extends ASTe
IIfNode node = (IIfNode) getNode(
"if (a) { b++; } else if (b) { c++; } else { d++; }",
IIfNode.class);
- visitor.visitIf(node);
+ asBlockWalker.visitIf(node);
assertOut("if (a) {\n\tb++;\n} else if (b) {\n\tc++;\n} else {\n\td++;\n}");
}
@@ -186,7 +186,7 @@ public class TestStatements extends ASTe
{
IIfNode node = (IIfNode) getNode(
"if (a) b++; else if (c) d++; else --e;", IIfNode.class);
- visitor.visitIf(node);
+ asBlockWalker.visitIf(node);
assertOut("if (a)\n\tb++;\nelse if (c)\n\td++;\nelse\n\t--e;");
}
@@ -200,7 +200,7 @@ public class TestStatements extends ASTe
IForLoopNode node = (IForLoopNode) getNode(
"for (var i:int = 0; i < len; i++) { break; }",
IForLoopNode.class);
- visitor.visitForLoop(node);
+ asBlockWalker.visitForLoop(node);
assertOut("for (var i:int = 0; i < len; i++) {\n\tbreak;\n}");
}
@@ -209,7 +209,7 @@ public class TestStatements extends ASTe
{
IForLoopNode node = (IForLoopNode) getNode(
"for (var i:int = 0; i < len; i++) break;", IForLoopNode.class);
- visitor.visitForLoop(node);
+ asBlockWalker.visitForLoop(node);
assertOut("for (var i:int = 0; i < len; i++)\n\tbreak;");
}
@@ -218,7 +218,7 @@ public class TestStatements extends ASTe
{
IForLoopNode node = (IForLoopNode) getNode("for (;;) { break; }",
IForLoopNode.class);
- visitor.visitForLoop(node);
+ asBlockWalker.visitForLoop(node);
assertOut("for (;;) {\n\tbreak;\n}");
}
@@ -227,7 +227,7 @@ public class TestStatements extends ASTe
{
IForLoopNode node = (IForLoopNode) getNode(
"for (var i:int in obj) { break; }", IForLoopNode.class);
- visitor.visitForLoop(node);
+ asBlockWalker.visitForLoop(node);
assertOut("for (var i:int in obj) {\n\tbreak;\n}");
}
@@ -236,7 +236,7 @@ public class TestStatements extends ASTe
{
IForLoopNode node = (IForLoopNode) getNode(
"for (var i:int in obj) break; ", IForLoopNode.class);
- visitor.visitForLoop(node);
+ asBlockWalker.visitForLoop(node);
assertOut("for (var i:int in obj)\n\tbreak;");
}
@@ -245,7 +245,7 @@ public class TestStatements extends ASTe
{
IForLoopNode node = (IForLoopNode) getNode(
"for each(var i:int in obj) { break; }", IForLoopNode.class);
- visitor.visitForLoop(node);
+ asBlockWalker.visitForLoop(node);
assertOut("for each (var i:int in obj) {\n\tbreak;\n}");
}
@@ -254,7 +254,7 @@ public class TestStatements extends ASTe
{
IForLoopNode node = (IForLoopNode) getNode(
"for each(var i:int in obj) break; ", IForLoopNode.class);
- visitor.visitForLoop(node);
+ asBlockWalker.visitForLoop(node);
assertOut("for each (var i:int in obj)\n\tbreak;");
}
@@ -267,7 +267,7 @@ public class TestStatements extends ASTe
{
IWhileLoopNode node = (IWhileLoopNode) getNode(
"while(a > b){a++;--b;}", IWhileLoopNode.class);
- visitor.visitWhileLoop(node);
+ asBlockWalker.visitWhileLoop(node);
assertOut("while (a > b) {\n\ta++;\n\t--b;\n}");
}
@@ -276,7 +276,7 @@ public class TestStatements extends ASTe
{
IWhileLoopNode node = (IWhileLoopNode) getNode("while(a > b) a++;",
IWhileLoopNode.class);
- visitor.visitWhileLoop(node);
+ asBlockWalker.visitWhileLoop(node);
assertOut("while (a > b)\n\ta++;");
}
@@ -289,7 +289,7 @@ public class TestStatements extends ASTe
{
IWhileLoopNode node = (IWhileLoopNode) getNode(
"do {a++;--b;} while(a > b);", IWhileLoopNode.class);
- visitor.visitWhileLoop(node);
+ asBlockWalker.visitWhileLoop(node);
assertOut("do {\n\ta++;\n\t--b;\n} while (a > b);");
}
@@ -298,7 +298,7 @@ public class TestStatements extends ASTe
{
IWhileLoopNode node = (IWhileLoopNode) getNode("do a++; while(a > b);",
IWhileLoopNode.class);
- visitor.visitWhileLoop(node);
+ asBlockWalker.visitWhileLoop(node);
assertOut("do\n\ta++;\nwhile (a > b);");
}
@@ -311,7 +311,7 @@ public class TestStatements extends ASTe
{
IThrowNode node = (IThrowNode) getNode("throw new Error('foo');",
IThrowNode.class);
- visitor.visitThrow(node);
+ asBlockWalker.visitThrow(node);
assertOut("throw new Error('foo')");
}
@@ -324,7 +324,7 @@ public class TestStatements extends ASTe
{
ITryNode node = (ITryNode) getNode("try { a; } catch (e:Error) { b; }",
ITryNode.class);
- visitor.visitTry(node);
+ asBlockWalker.visitTry(node);
assertOut("try {\n\ta;\n} catch (e:Error) {\n\tb;\n}");
}
@@ -334,7 +334,7 @@ public class TestStatements extends ASTe
ITryNode node = (ITryNode) getNode(
"try { a; } catch (e:Error) { b; } finally { c; }",
ITryNode.class);
- visitor.visitTry(node);
+ asBlockWalker.visitTry(node);
assertOut("try {\n\ta;\n} catch (e:Error) {\n\tb;\n} finally {\n\tc;\n}");
}
@@ -344,7 +344,7 @@ public class TestStatements extends ASTe
ITryNode node = (ITryNode) getNode(
"try { a; } catch (e:Error) { b; } catch (f:Error) { c; } finally { d; }",
ITryNode.class);
- visitor.visitTry(node);
+ asBlockWalker.visitTry(node);
assertOut("try {\n\ta;\n} catch (e:Error) {\n\tb;\n} catch (f:Error) {\n\tc;\n} finally {\n\td;\n}");
}
@@ -353,7 +353,7 @@ public class TestStatements extends ASTe
{
ITryNode node = (ITryNode) getNode(
"try { a; } catch (e:Error) { } finally { }", ITryNode.class);
- visitor.visitTry(node);
+ asBlockWalker.visitTry(node);
assertOut("try {\n\ta;\n} catch (e:Error) {\n} finally {\n}");
}
@@ -366,7 +366,7 @@ public class TestStatements extends ASTe
{
ISwitchNode node = (ISwitchNode) getNode("switch(i){case 1: break;}",
ISwitchNode.class);
- visitor.visitSwitch(node);
+ asBlockWalker.visitSwitch(node);
assertOut("switch (i) {\n\tcase 1:\n\t\tbreak;\n}");
}
@@ -375,7 +375,7 @@ public class TestStatements extends ASTe
{
ISwitchNode node = (ISwitchNode) getNode(
"switch(i){case 1: { break; }}", ISwitchNode.class);
- visitor.visitSwitch(node);
+ asBlockWalker.visitSwitch(node);
// TODO case BLOCK statements are SYNTHESIZED so they will never show BRACES
// without extra help from us
assertOut("switch (i) {\n\tcase 1:\n\t\tbreak;\n}");
@@ -386,7 +386,7 @@ public class TestStatements extends ASTe
{
ISwitchNode node = (ISwitchNode) getNode(
"switch(i){case 1: break; default: return;}", ISwitchNode.class);
- visitor.visitSwitch(node);
+ asBlockWalker.visitSwitch(node);
assertOut("switch (i) {\n\tcase 1:\n\t\tbreak;\n\tdefault:\n\t\treturn;\n}");
}
@@ -400,7 +400,7 @@ public class TestStatements extends ASTe
LabeledStatementNode node = (LabeledStatementNode) getNode(
"foo: for each(var i:int in obj) { break foo; }",
LabeledStatementNode.class);
- visitor.visitLabeledStatement(node);
+ asBlockWalker.visitLabeledStatement(node);
assertOut("foo : for each (var i:int in obj) {\n\tbreak foo;\n}");
}
@@ -411,7 +411,7 @@ public class TestStatements extends ASTe
LabeledStatementNode node = (LabeledStatementNode) getNode(
"foo: for each(var i:int in obj) break foo;",
LabeledStatementNode.class);
- visitor.visitLabeledStatement(node);
+ asBlockWalker.visitLabeledStatement(node);
assertOut("foo : for each (var i:int in obj)\n\tbreak foo;");
}
@@ -423,7 +423,7 @@ public class TestStatements extends ASTe
public void testVisitWith()
{
IWithNode node = (IWithNode) getNode("with (a) { b; }", IWithNode.class);
- visitor.visitWith(node);
+ asBlockWalker.visitWith(node);
assertOut("with (a) {\n\tb;\n}");
}
@@ -431,7 +431,7 @@ public class TestStatements extends ASTe
public void testVisitWith_1a()
{
IWithNode node = (IWithNode) getNode("with (a) b;", IWithNode.class);
- visitor.visitWith(node);
+ asBlockWalker.visitWith(node);
assertOut("with (a)\n\tb;");
}
@@ -450,7 +450,7 @@ public class TestStatements extends ASTe
+ " eee.dd; eee.dd; eee.dd; eee.dd;} }"
+ "foo: for each(var i:int in obj) break foo;",
IFileNode.class);
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut("package {\n\tpublic class A {\n\t\tfunction a():void {\n\t\t\ttry {\n\t\t\t\ta;\n\t\t\t} catch (e:Error) {\n\t\t\t\tif (a) {\n\t\t\t\t\tif (b) {\n\t\t\t\t\t\tif (c)\n\t\t\t\t\t\t\tb;\n\t\t\t\t\t\telse if (f)\n\t\t\t\t\t\t\ta;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\te;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t}\n\t\t\tif (d)\n\t\t\t\tfor (var i:int = 0; i < len; i++)\n\t\t\t\t\tbreak;\n\t\t\tif (a) {\n\t\t\t\twith (ab) {\n\t\t\t\t\tc();\n\t\t\t\t}\n\t\t\t\tdo {\n\t\t\t\t\ta++;\n\t\t\t\t\tdo\n\t\t\t\t\t\ta++;\n\t\t\t\t\twhile (a > b);\n\t\t\t\t} while (c > d);\n\t\t\t}\n\t\t\tif (b) {\n\t\t\t\ttry {\n\t\t\t\t\ta;\n\t\t\t\t\tthrow new Error('foo');\n\t\t\t\t} catch (e:Error) {\n\t\t\t\t\tswitch (i) {\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} catch (f:Error) {\n\t\t\t\t\tc;\n\t\t\t\t\teee.dd;\n\t\t\t\t} finally {\n\t\t\t\t\td;\n\t\t\t\t\tvar a:Object = function(foo:int, bar:String = 'goo')
:int {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t};\n\t\t\t\t\teee.dd;\n\t\t\t\t\teee.dd;\n\t\t\t\t\teee.dd;\n\t\t\t\t\teee.dd;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfoo : for each (var i:int in obj)\n\t\t\t\tbreak foo;;\n\t}\n}\n}");
}
}
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDClassA.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDClassA.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDClassA.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDClassA.java Thu Feb 28 13:53:18 2013
@@ -19,7 +19,7 @@
package org.apache.flex.compiler.internal.js.codegen.amd;
-import org.apache.flex.compiler.test.AMDTestBase;
+import org.apache.flex.compiler.internal.test.AMDTestBase;
import org.apache.flex.compiler.tree.as.IFunctionNode;
import org.apache.flex.compiler.tree.as.IGetterNode;
import org.apache.flex.compiler.tree.as.ISetterNode;
@@ -44,7 +44,7 @@ public class TestAMDClassA extends AMDTe
public void test_field_msg()
{
IVariableNode vnode = findField("_msg", classNode);
- visitor.visitVariable(vnode);
+ asBlockWalker.visitVariable(vnode);
assertOut("_msg$1: {\n\tvalue:0,\n\twritable:true\n}");
}
@@ -52,7 +52,7 @@ public class TestAMDClassA extends AMDTe
public void test_constructor()
{
IFunctionNode vnode = findFunction("A", classNode);
- visitor.visitFunction(vnode);
+ asBlockWalker.visitFunction(vnode);
assertOut("function A(msg) {\n\tthis.msg = msg;\n}");
}
@@ -60,7 +60,7 @@ public class TestAMDClassA extends AMDTe
public void test_get_msg()
{
IGetterNode node = findGetter("msg", classNode);
- visitor.visitGetter(node);
+ asBlockWalker.visitGetter(node);
assertOut("msg: {\n\tget: function msg$get() {\n\t\treturn String(this._msg$1);\n\t},"
+ "\n\tset: function msg$set(value) {\n\t\tthis._msg$1 = parseInt(value, 10);\n\t}\n}");
}
@@ -69,7 +69,7 @@ public class TestAMDClassA extends AMDTe
public void test_set_msg()
{
ISetterNode node = findSetter("msg", classNode);
- visitor.visitSetter(node);
+ asBlockWalker.visitSetter(node);
assertOut("msg: {\n\tget: function msg$get() {\n\t\treturn String(this._msg$1);\n\t},"
+ "\n\tset: function msg$set(value) {\n\t\tthis._msg$1 = parseInt(value, 10);\n\t}\n}");
}
@@ -78,7 +78,7 @@ public class TestAMDClassA extends AMDTe
public void test_secret()
{
IFunctionNode vnode = findFunction("secret", classNode);
- visitor.visitFunction(vnode);
+ asBlockWalker.visitFunction(vnode);
assertOut("secret$1: function secret(n) {\n\treturn this.msg + n;\n}");
}
@@ -86,7 +86,7 @@ public class TestAMDClassA extends AMDTe
public void test_foo()
{
IFunctionNode vnode = findFunction("foo", classNode);
- visitor.visitFunction(vnode);
+ asBlockWalker.visitFunction(vnode);
assertOut("foo: function foo(x) {\n\treturn this.secret$1(A.bar(x));\n}");
}
@@ -94,7 +94,7 @@ public class TestAMDClassA extends AMDTe
public void test_baz()
{
IFunctionNode vnode = findFunction("baz", classNode);
- visitor.visitFunction(vnode);
+ asBlockWalker.visitFunction(vnode);
assertOut("baz: function baz() {\n\tvar tmp = AS3.bind(this, "
+ "\"secret$1\");\n\treturn tmp(\"-bound\");\n}");
}
@@ -103,7 +103,7 @@ public class TestAMDClassA extends AMDTe
public void test_bar()
{
IFunctionNode vnode = findFunction("bar", classNode);
- visitor.visitFunction(vnode);
+ asBlockWalker.visitFunction(vnode);
assertOut("bar: function bar(x) {\n\treturn x + 1;\n}");
}
@@ -111,7 +111,7 @@ public class TestAMDClassA extends AMDTe
public void test_file()
{
// not going to put this test production in until everything is concrete and agreed upon
- visitor.visitFile(fileNode);
+ asBlockWalker.visitFile(fileNode);
//assertOut("");
}
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDClassB.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDClassB.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDClassB.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDClassB.java Thu Feb 28 13:53:18 2013
@@ -19,7 +19,7 @@
package org.apache.flex.compiler.internal.js.codegen.amd;
-import org.apache.flex.compiler.test.AMDTestBase;
+import org.apache.flex.compiler.internal.test.AMDTestBase;
import org.apache.flex.compiler.tree.as.IFunctionNode;
import org.apache.flex.compiler.tree.as.IVariableNode;
import org.junit.Test;
@@ -40,7 +40,7 @@ public class TestAMDClassB extends AMDTe
public void test_nowPlusOne()
{
IFunctionNode vnode = findFunction("nowPlusOne", classNode);
- visitor.visitFunction(vnode);
+ asBlockWalker.visitFunction(vnode);
assertOut("nowPlusOne: function nowPlusOne() {\n\treturn new Date(B.now.getTime() + 60 * 60 * 1000);\n}");
}
@@ -48,7 +48,7 @@ public class TestAMDClassB extends AMDTe
public void test_constructor()
{
IFunctionNode vnode = findFunction("B", classNode);
- visitor.visitFunction(vnode);
+ asBlockWalker.visitFunction(vnode);
assertOut("function B(msg, count) {\n\tthis.barfoo = (A._ || A._$get()).bar(3);" +
"\n\tSuper.call(this, msg);\n\tthis.count = count;\n\ttrace(\"now: \" + B.now);\n}");
}
@@ -57,7 +57,7 @@ public class TestAMDClassB extends AMDTe
public void test_count()
{
IVariableNode node = findField("count", classNode);
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("count: {\n\tvalue:0,\n\twritable:true\n}");
}
@@ -65,7 +65,7 @@ public class TestAMDClassB extends AMDTe
public void test_override_foo()
{
IFunctionNode vnode = findFunction("foo", classNode);
- visitor.visitFunction(vnode);
+ asBlockWalker.visitFunction(vnode);
assertOut("foo: function foo(x) {\n\treturn this.foo$2(x + 2) + \"-sub\";\n}");
}
@@ -73,7 +73,7 @@ public class TestAMDClassB extends AMDTe
public void test_now()
{
IVariableNode node = findField("now", classNode);
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("B.now = new Date()");
}
@@ -81,7 +81,7 @@ public class TestAMDClassB extends AMDTe
public void test_file()
{
// not going to put this test production in until everything is concrete and agreed upon
- visitor.visitFile(fileNode);
+ asBlockWalker.visitFile(fileNode);
//assertOut("");
}
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDEmiter.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDEmiter.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDEmiter.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDEmiter.java Thu Feb 28 13:53:18 2013
@@ -19,9 +19,9 @@
package org.apache.flex.compiler.internal.js.codegen.amd;
-import org.apache.flex.compiler.clients.IBackend;
+import org.apache.flex.compiler.common.driver.IBackend;
import org.apache.flex.compiler.internal.js.driver.amd.AMDBackend;
-import org.apache.flex.compiler.test.ASTestBase;
+import org.apache.flex.compiler.internal.test.ASTestBase;
import org.apache.flex.compiler.tree.as.IFileNode;
import org.apache.flex.compiler.tree.as.IFunctionNode;
import org.junit.Ignore;
@@ -50,7 +50,7 @@ public class TestAMDEmiter extends ASTes
+ "public function myFunction(value: String): String{"
+ "return \"Don't \" + _privateVar + value; }";
IFileNode node = compileAS(code);
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut("package com.example.components {\n\tpublic class MyTextButton extends TextButton {\n\t\tcom.example.components.MyTextButton = function() {\n\t\t\tif (foo() != 42) {\n\t\t\t\tbar();\n\t\t\t}\n\t\t}\n\t\tprivate var _privateVar:String = \"do \";\n\t\tpublic var publicProperty:Number = 100;\n\t\tcom.example.components.MyTextButton.prototype.myFunction = function(value) {\n\t\t\treturn \"Don't \" + _privateVar + value;\n\t\t}\n\t}\n}");
}
@@ -59,7 +59,7 @@ public class TestAMDEmiter extends ASTes
public void testSimpleMethod()
{
IFunctionNode node = getMethod("function method1():void{\n}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("A.prototype.method1 = function() {\n}");
}
@@ -68,7 +68,7 @@ public class TestAMDEmiter extends ASTes
public void testSimpleParameterReturnType()
{
IFunctionNode node = getMethod("function method1(bar:int):int{\n}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("A.prototype.method1 = function(bar) {\n}");
}
@@ -77,7 +77,7 @@ public class TestAMDEmiter extends ASTes
public void testSimpleMultipleParameter()
{
IFunctionNode node = getMethod("function method1(bar:int, baz:String, goo:A):void{\n}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("A.prototype.method1 = function(bar, baz, goo) {\n}");
}
@@ -97,7 +97,7 @@ public class TestAMDEmiter extends ASTes
}
*/
IFunctionNode node = getMethod("function method1(p1:int, p2:int, p3:int = 3, p4:int = 4):int{return p1 + p2 + p3 + p4;}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("A.prototype.method1 = function(p1, p2, p3, p4) {\n\tif (arguments.length < 4) "
+ "{\n\t\tif (arguments.length < 3) {\n\t\t\tp3 = 3;\n\t\t}\n\t\tp4 = 4;\n\t}"
+ "\n\treturn p1 + p2 + p3 + p4;\n}");
@@ -118,7 +118,7 @@ public class TestAMDEmiter extends ASTes
}
*/
IFunctionNode node = getMethod("function method1(bar:int = 42, bax:int = 4):void{if (a) foo();}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("A.prototype.method1 = function(bar, bax) {\n\tif (arguments.length < 2) {\n\t\t"
+ "if (arguments.length < 1) {\n\t\t\tbar = 42;\n\t\t}\n\t\tbax = 4;\n\t}\n\t"
+ "if (a)\n\t\tfoo();\n}");
@@ -139,7 +139,7 @@ public class TestAMDEmiter extends ASTes
}
*/
IFunctionNode node = getMethod("function method1(bar:int = 42, bax:int = 4):void{\n}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("A.prototype.method1 = function(bar, bax) {\n\tif (arguments.length < 2) {\n\t\t"
+ "if (arguments.length < 1) {\n\t\t\tbar = 42;\n\t\t}\n\t\tbax = 4;\n\t}\n}");
}
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDInterfaceI.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDInterfaceI.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDInterfaceI.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDInterfaceI.java Thu Feb 28 13:53:18 2013
@@ -19,7 +19,7 @@
package org.apache.flex.compiler.internal.js.codegen.amd;
-import org.apache.flex.compiler.test.AMDTestBase;
+import org.apache.flex.compiler.internal.test.AMDTestBase;
import org.junit.Test;
/**
@@ -37,7 +37,7 @@ public class TestAMDInterfaceI extends A
@Test
public void test_file()
{
- visitor.visitFile(fileNode);
+ asBlockWalker.visitFile(fileNode);
assertOut("define([\"exports\", \"runtime/AS3\"], function($exports, AS3) {" +
"\n\t\"use strict\"; \n\tAS3.interface_($exports, {\n\t\tpackage_: " +
"\"com.acme\",\n\t\tinterface_: \"I\"\n\t});\n});");
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDInterfaceIOther.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDInterfaceIOther.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDInterfaceIOther.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDInterfaceIOther.java Thu Feb 28 13:53:18 2013
@@ -19,7 +19,7 @@
package org.apache.flex.compiler.internal.js.codegen.amd;
-import org.apache.flex.compiler.test.AMDTestBase;
+import org.apache.flex.compiler.internal.test.AMDTestBase;
import org.junit.Test;
/**
@@ -37,7 +37,7 @@ public class TestAMDInterfaceIOther exte
@Test
public void test_file()
{
- visitor.visitFile(fileNode);
+ asBlockWalker.visitFile(fileNode);
assertOut("define([\"exports\", \"runtime/AS3\"], function($exports, AS3) {" +
"\n\t\"use strict\"; \n\tAS3.interface_($exports, {\n\t\tpackage_: " +
"\"com.acme.sub\",\n\t\tinterface_: \"IOther\"\n\t});\n});");
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDInterfaceISub.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDInterfaceISub.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDInterfaceISub.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDInterfaceISub.java Thu Feb 28 13:53:18 2013
@@ -19,7 +19,7 @@
package org.apache.flex.compiler.internal.js.codegen.amd;
-import org.apache.flex.compiler.test.AMDTestBase;
+import org.apache.flex.compiler.internal.test.AMDTestBase;
import org.junit.Test;
/**
@@ -37,7 +37,7 @@ public class TestAMDInterfaceISub extend
@Test
public void test_file()
{
- visitor.visitFile(fileNode);
+ asBlockWalker.visitFile(fileNode);
assertOut("define([\"exports\", \"runtime/AS3\", \"classes/com/acme/I\"], " +
"function($exports, AS3, I) {\n\t\"use strict\"; \n\tAS3.interface_($exports, {" +
"\n\t\tpackage_: \"com.acme.sub\",\n\t\tinterface_: \"ISub\"\n\t\textends_: " +
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDPackage.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDPackage.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDPackage.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/TestAMDPackage.java Thu Feb 28 13:53:18 2013
@@ -21,7 +21,7 @@ package org.apache.flex.compiler.interna
import java.io.IOException;
-import org.apache.flex.compiler.clients.IBackend;
+import org.apache.flex.compiler.common.driver.IBackend;
import org.apache.flex.compiler.internal.as.codegen.TestPackage;
import org.apache.flex.compiler.internal.js.driver.amd.AMDBackend;
import org.apache.flex.compiler.tree.as.IFileNode;
@@ -42,7 +42,7 @@ public class TestAMDPackage extends Test
public void testPackage_Simple()
{
IFileNode node = compileAS("package{}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut("");
}
@@ -51,7 +51,7 @@ public class TestAMDPackage extends Test
public void testPackage_SimpleName()
{
IFileNode node = compileAS("package foo {}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut("");
}
@@ -60,7 +60,7 @@ public class TestAMDPackage extends Test
public void testPackage_Name()
{
IFileNode node = compileAS("package foo.bar.baz {}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut("");
}
@@ -69,7 +69,7 @@ public class TestAMDPackage extends Test
public void testPackageSimple_Class()
{
IFileNode node = compileAS("package {public class A{}}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
//assertOut("");
}
@@ -84,7 +84,7 @@ public class TestAMDPackage extends Test
public void testPackageQualified_Class()
{
IFileNode node = compileAS("package foo.bar.baz {public class A{}}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
//assertOut("");
}
@@ -93,7 +93,7 @@ public class TestAMDPackage extends Test
public void testPackageQualified_ClassBody()
{
IFileNode node = compileAS("package foo.bar.baz {public class A{public function A(){}}}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
//assertOut("");
}
@@ -102,7 +102,7 @@ public class TestAMDPackage extends Test
public void testPackageQualified_ClassBodyMethodContents()
{
IFileNode node = compileAS("package foo.bar.baz {public class A{public function A(){if (a){for (var i:Object in obj){doit();}}}}}");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
//assertOut("");
}
@@ -110,7 +110,7 @@ public class TestAMDPackage extends Test
public void testMethod()
{
IFunctionNode node = getMethod("function foo(){}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("A.prototype.foo = function() {\n}");
}
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogAccessorMembers.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogAccessorMembers.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogAccessorMembers.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogAccessorMembers.java Thu Feb 28 13:53:18 2013
@@ -19,7 +19,7 @@
package org.apache.flex.compiler.internal.js.codegen.goog;
-import org.apache.flex.compiler.clients.IBackend;
+import org.apache.flex.compiler.common.driver.IBackend;
import org.apache.flex.compiler.internal.as.codegen.TestAccessorMembers;
import org.apache.flex.compiler.internal.js.driver.goog.GoogBackend;
import org.apache.flex.compiler.tree.as.IGetterNode;
@@ -40,7 +40,7 @@ public class TestGoogAccessorMembers ext
public void testGetAccessor()
{
IGetterNode node = (IGetterNode) getAccessor("function get foo():int{}");
- visitor.visitGetter(node);
+ asBlockWalker.visitGetter(node);
assertOut("Object.defineProperty(\n\tA.prototype, \n\t'foo', "
+ "\n\t{get:function() {\n\t}, configurable:true}\n)");
}
@@ -49,7 +49,7 @@ public class TestGoogAccessorMembers ext
public void testGetAccessor_withBody()
{
IGetterNode node = (IGetterNode) getAccessor("function get foo():int{return -1;}");
- visitor.visitGetter(node);
+ asBlockWalker.visitGetter(node);
assertOut("Object.defineProperty(\n\tA.prototype, \n\t'foo', "
+ "\n\t{get:function() {\n\t\tvar self = this;\n\t\treturn -1;\n\t}, configurable:true}\n)");
}
@@ -59,7 +59,7 @@ public class TestGoogAccessorMembers ext
public void testGetAccessor_withNamespace()
{
IGetterNode node = (IGetterNode) getAccessor("public function get foo():int{return -1;}");
- visitor.visitGetter(node);
+ asBlockWalker.visitGetter(node);
assertOut("Object.defineProperty(\n\tA.prototype, \n\t'foo', "
+ "\n\t{get:function() {\n\t\tvar self = this;\n\t\treturn -1;\n\t}, configurable:true}\n)");
}
@@ -72,7 +72,7 @@ public class TestGoogAccessorMembers ext
// 'super' since the JS getter is actually an
// anonymous function... goog.bind or goog.partial?
IGetterNode node = (IGetterNode) getAccessor("public override function get foo():int{super.foo(); return -1;}");
- visitor.visitGetter(node);
+ asBlockWalker.visitGetter(node);
assertOut("Object.defineProperty(\n\tA.prototype, \n\t'foo', \n\t{get:function() {\n\t\tvar self = this;\n\t\tgoog.base(this, 'foo');\n\t\treturn -1;\n\t}, configurable:true}\n)");
}
@@ -81,7 +81,7 @@ public class TestGoogAccessorMembers ext
public void testGetAccessor_withStatic()
{
IGetterNode node = (IGetterNode) getAccessor("public static function get foo():int{return -1;}");
- visitor.visitGetter(node);
+ asBlockWalker.visitGetter(node);
assertOut("Object.defineProperty(\n\tA, \n\t'foo', \n\t{get:function() {\n\t\tvar self = this;\n\t\treturn -1;\n\t}, configurable:true}\n)");
}
@@ -90,7 +90,7 @@ public class TestGoogAccessorMembers ext
public void testSetAccessor()
{
ISetterNode node = (ISetterNode) getAccessor("function set foo(value:int):void{}");
- visitor.visitSetter(node);
+ asBlockWalker.visitSetter(node);
assertOut("Object.defineProperty(\n\tA.prototype, \n\t'foo', \n\t{set:function(value)"
+ " {\n\t}, configurable:true}\n)");
}
@@ -99,7 +99,7 @@ public class TestGoogAccessorMembers ext
public void testSetAccessor_withBody()
{
ISetterNode node = (ISetterNode) getAccessor("function set foo(value:int):void{trace('haai');}");
- visitor.visitSetter(node);
+ asBlockWalker.visitSetter(node);
assertOut("Object.defineProperty(\n\tA.prototype, \n\t'foo', "
+ "\n\t{set:function(value) {\n\t\tvar self = this;\n\t\ttrace('haai');\n\t}, configurable:true}\n)");
}
@@ -109,7 +109,7 @@ public class TestGoogAccessorMembers ext
public void testSetAccessor_withNamespace()
{
ISetterNode node = (ISetterNode) getAccessor("public function set foo(value:int):void{}");
- visitor.visitSetter(node);
+ asBlockWalker.visitSetter(node);
assertOut("Object.defineProperty(\n\tA.prototype, \n\t'foo', \n\t{set:function(value)"
+ " {\n\t}, configurable:true}\n)");
}
@@ -120,7 +120,7 @@ public class TestGoogAccessorMembers ext
{
// TODO (erikdebruin) see: testGetAccessor_withNamespaceOverride
ISetterNode node = (ISetterNode) getAccessor("public override function set foo(value:int):void{super.foo();}");
- visitor.visitSetter(node);
+ asBlockWalker.visitSetter(node);
assertOut("Object.defineProperty(\n\tA.prototype, \n\t'foo', \n\t{set:function(value) {\n\t\tvar self = this;\n\t\tgoog.base(this, 'foo');\n\t}, configurable:true}\n)");
}
@@ -129,7 +129,7 @@ public class TestGoogAccessorMembers ext
public void testSetAccessor_withStatic()
{
ISetterNode node = (ISetterNode) getAccessor("public static function set foo(value:int):void{}");
- visitor.visitSetter(node);
+ asBlockWalker.visitSetter(node);
assertOut("Object.defineProperty(\n\tA, \n\t'foo', \n\t{set:function(value) {\n\t}, configurable:true}\n)");
}
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogClass.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogClass.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogClass.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogClass.java Thu Feb 28 13:53:18 2013
@@ -19,7 +19,7 @@
package org.apache.flex.compiler.internal.js.codegen.goog;
-import org.apache.flex.compiler.clients.IBackend;
+import org.apache.flex.compiler.common.driver.IBackend;
import org.apache.flex.compiler.internal.as.codegen.TestClass;
import org.apache.flex.compiler.internal.js.driver.goog.GoogBackend;
import org.apache.flex.compiler.tree.as.IClassNode;
@@ -39,7 +39,7 @@ public class TestGoogClass extends TestC
public void testSimple()
{
IClassNode node = getClassNode("public class A{}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
}
@@ -50,7 +50,7 @@ public class TestGoogClass extends TestC
// (erikdebruin) the AS compiler will enforce 'internal' namespace,
// in JS we ignore it
IClassNode node = getClassNode("internal class A{}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
}
@@ -61,7 +61,7 @@ public class TestGoogClass extends TestC
// (erikdebruin) the AS compiler will enforce the 'final' keyword,
// in JS we ignore it
IClassNode node = getClassNode("public final class A{}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
}
@@ -71,7 +71,7 @@ public class TestGoogClass extends TestC
{
// (erikdebruin) all JS objects are 'dynamic' by design
IClassNode node = getClassNode("public dynamic class A{}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
}
@@ -80,7 +80,7 @@ public class TestGoogClass extends TestC
public void testSimpleExtends()
{
IClassNode node = getClassNode("public class A extends Button {public function A() {}}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n * @extends {spark.components.Button}\n */\norg.apache.flex.A = function() {\n\tgoog.base(this);\n}\ngoog.inherits(org.apache.flex.A, spark.components.Button);");
}
@@ -89,7 +89,7 @@ public class TestGoogClass extends TestC
public void testSimpleImplements()
{
IClassNode node = getClassNode("public class A implements IEventDispatcher {public function A() {}}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n * @implements {flash.events.IEventDispatcher}\n */\norg.apache.flex.A = function() {\n};");
}
@@ -98,7 +98,7 @@ public class TestGoogClass extends TestC
public void testSimpleImplementsMultiple()
{
IClassNode node = getClassNode("public class A implements IEventDispatcher, ILogger {public function A() {}}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n * @implements {flash.events.IEventDispatcher}\n * @implements {mx.logging.ILogger}\n */\norg.apache.flex.A = function() {\n};");
}
@@ -107,7 +107,7 @@ public class TestGoogClass extends TestC
public void testSimpleExtendsImplements()
{
IClassNode node = getClassNode("public class A extends Button implements IEventDispatcher {public function A() {}}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n * @extends {spark.components.Button}\n * @implements {flash.events.IEventDispatcher}\n */\norg.apache.flex.A = function() {\n\tgoog.base(this);\n}\ngoog.inherits(org.apache.flex.A, spark.components.Button);");
}
@@ -116,7 +116,7 @@ public class TestGoogClass extends TestC
public void testSimpleExtendsImplementsMultiple()
{
IClassNode node = getClassNode("public class A extends Button implements IEventDispatcher, ILogger {public function A() {}}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n * @extends {spark.components.Button}\n * @implements {flash.events.IEventDispatcher}\n * @implements {mx.logging.ILogger}\n */\norg.apache.flex.A = function() {\n\tgoog.base(this);\n}\ngoog.inherits(org.apache.flex.A, spark.components.Button);");
}
@@ -125,7 +125,7 @@ public class TestGoogClass extends TestC
public void testSimpleFinalExtendsImplementsMultiple()
{
IClassNode node = getClassNode("public final class A extends Button implements IEventDispatcher, ILogger {public function A() {}}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n * @extends {spark.components.Button}\n * @implements {flash.events.IEventDispatcher}\n * @implements {mx.logging.ILogger}\n */\norg.apache.flex.A = function() {\n\tgoog.base(this);\n}\ngoog.inherits(org.apache.flex.A, spark.components.Button);");
}
@@ -134,7 +134,7 @@ public class TestGoogClass extends TestC
public void testQualifiedExtendsImplementsMultiple()
{
IClassNode node = getClassNode("public class A extends spark.components.Button implements flash.events.IEventDispatcher, mx.logging.ILogger {public function A() {}}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n * @extends {spark.components.Button}\n * @implements {flash.events.IEventDispatcher}\n * @implements {mx.logging.ILogger}\n */\norg.apache.flex.A = function() {\n\tgoog.base(this);\n}\ngoog.inherits(org.apache.flex.A, spark.components.Button);");
}
@@ -143,7 +143,7 @@ public class TestGoogClass extends TestC
public void testConstructor()
{
IClassNode node = getClassNode("public class A {public function A() {super('foo', 42);}}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n\tvar self = this;\n\tgoog.base(this, 'foo', 42);\n};");
}
@@ -152,7 +152,7 @@ public class TestGoogClass extends TestC
public void testConstructor_withArguments()
{
IClassNode node = getClassNode("public class A {public function A(arg1:String, arg2:int) {}}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n * @param {string} arg1\n * @param {number} arg2\n */\norg.apache.flex.A = function(arg1, arg2) {\n};");
}
@@ -161,7 +161,7 @@ public class TestGoogClass extends TestC
public void testExtendsConstructor_withArguments()
{
IClassNode node = getClassNode("public class A extends spark.components.Button {public function A(arg1:String, arg2:int) {}}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n * @extends {spark.components.Button}\n * @param {string} arg1\n * @param {number} arg2\n */\norg.apache.flex.A = function(arg1, arg2) {\n\tgoog.base(this, arg1, arg2);\n}\ngoog.inherits(org.apache.flex.A, spark.components.Button);");
}
@@ -171,7 +171,7 @@ public class TestGoogClass extends TestC
{
IClassNode node = getClassNode("public class A {public var a:Object;protected var b:String; "
+ "private var c:int; internal var d:uint; var e:Number}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n/**\n * @type {Object}\n */\norg.apache.flex.A.prototype.a;\n\n/**\n * @protected\n * @type {string}\n */\norg.apache.flex.A.prototype.b;\n\n/**\n * @private\n * @type {number}\n */\norg.apache.flex.A.prototype.c;\n\n/**\n * @type {number}\n */\norg.apache.flex.A.prototype.d;\n\n/**\n * @type {number}\n */\norg.apache.flex.A.prototype.e;");
}
@@ -184,7 +184,7 @@ public class TestGoogClass extends TestC
+ "protected static const B:Number = 42;"
+ "private static const C:Number = 42;"
+ "foo_bar static const C:String = 'me' + 'you';");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n/**\n * @const\n * @type {number}\n */\norg.apache.flex.A.A = 42;\n\n/**\n * @protected\n * @const\n * @type {number}\n */\norg.apache.flex.A.B = 42;\n\n/**\n * @private\n * @const\n * @type {number}\n */\norg.apache.flex.A.C = 42;\n\n/**\n * @const\n * @type {string}\n */\norg.apache.flex.A.C = 'me' + 'you';");
}
@@ -203,7 +203,7 @@ public class TestGoogClass extends TestC
+ "internal function set foo5(value:Object):void{}"
+ "foo_bar function get foo6():Object{return null;}"
+ "foo_bar function set foo6(value:Object):void{}" + "}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n/**\n * @type {Object}\n */\norg.apache.flex.A.prototype.foo1;\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo1', \n\t{get:function() {\n\t\tvar self = this;\n\t\treturn null;\n\t}, configurable:true}\n);\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo1', \n\t{set:function(value) {\n\t}, configurable:true}\n);\n\n/**\n * @protected\n * @type {Object}\n */\norg.apache.flex.A.prototype.foo2;\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo2', \n\t{get:function() {\n\t\tvar self = this;\n\t\treturn null;\n\t}, configurable:true}\n);\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo2', \n\t{set:function(value) {\n\t}, configurable:true}\n);\n\n/**\n * @private\n * @type {Object}\n */\norg.apache.flex.A.prototype.foo3;\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo3', \n\t{get:function() {\n\t\tvar self
= this;\n\t\treturn null;\n\t}, configurable:true}\n);\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo3', \n\t{set:function(value) {\n\t}, configurable:true}\n);\n\n/**\n * @type {Object}\n */\norg.apache.flex.A.prototype.foo5;\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo5', \n\t{get:function() {\n\t\tvar self = this;\n\t\treturn null;\n\t}, configurable:true}\n);\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo5', \n\t{set:function(value) {\n\t}, configurable:true}\n);\n\n/**\n * @type {Object}\n */\norg.apache.flex.A.prototype.foo6;\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo6', \n\t{get:function() {\n\t\tvar self = this;\n\t\treturn null;\n\t}, configurable:true}\n);\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo6', \n\t{set:function(value) {\n\t}, configurable:true}\n);");
}
@@ -221,7 +221,7 @@ public class TestGoogClass extends TestC
+ "foo_bar function foo6(value:Object):void{}"
+ "public static function foo7(value:Object):void{}"
+ "foo_bar static function foo7(value:Object):void{}" + "}");
- visitor.visitClass(node);
+ asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n/**\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1 = function() {\n\tvar self = this;\n\treturn null;\n};\n\n/**\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1a = function() {\n\tvar self = this;\n\treturn null;\n};\n\n/**\n * @return {Object}\n * @override\n */\norg.apache.flex.A.prototype.foo1b = function() {\n\tvar self = this;\n\treturn goog.base(this, 'foo1b');\n};\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo2 = function(value) {\n};\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo3 = function(value) {\n};\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo5 = function(value) {\n};\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo6 = function(value) {\n};\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.foo7 = function(value) {\n};\n\n/**\n * @param {Object} value\n
*/\norg.apache.flex.A.foo7 = function(value) {\n};");
}
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogEmiter.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogEmiter.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogEmiter.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogEmiter.java Thu Feb 28 13:53:18 2013
@@ -19,9 +19,9 @@
package org.apache.flex.compiler.internal.js.codegen.goog;
-import org.apache.flex.compiler.clients.IBackend;
+import org.apache.flex.compiler.common.driver.IBackend;
import org.apache.flex.compiler.internal.js.driver.goog.GoogBackend;
-import org.apache.flex.compiler.test.ASTestBase;
+import org.apache.flex.compiler.internal.test.ASTestBase;
import org.apache.flex.compiler.tree.as.IFileNode;
import org.apache.flex.compiler.tree.as.IFunctionNode;
import org.junit.Test;
@@ -48,7 +48,7 @@ public class TestGoogEmiter extends ASTe
+ "public function myFunction(value: String): String{"
+ "return \"Don't \" + _privateVar + value; }";
IFileNode node = compileAS(code);
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut("goog.provide('com.example.components.MyTextButton');\n\ngoog.require('spark.components.Button');\n\n/**\n * @constructor\n * @extends {spark.components.Button}\n */\ncom.example.components.MyTextButton = function() {\n\tvar self = this;\n\tgoog.base(this);\n\tif (foo() != 42) {\n\t\tbar();\n\t}\n}\ngoog.inherits(com.example.components.MyTextButton, spark.components.Button);\n\n/**\n * @private\n * @type {string}\n */\ncom.example.components.MyTextButton.prototype._privateVar = \"do \";\n\n/**\n * @type {number}\n */\ncom.example.components.MyTextButton.prototype.publicProperty = 100;\n\n/**\n * @param {string} value\n * @return {string}\n */\ncom.example.components.MyTextButton.prototype.myFunction = function(value) {\n\tvar self = this;\n\treturn \"Don't \" + self._privateVar + value;\n};");
}
@@ -56,7 +56,7 @@ public class TestGoogEmiter extends ASTe
public void testSimpleMethod()
{
IFunctionNode node = getMethod("function method1():void{\n}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("A.prototype.method1 = function() {\n}");
}
@@ -64,7 +64,7 @@ public class TestGoogEmiter extends ASTe
public void testSimpleParameterReturnType()
{
IFunctionNode node = getMethodWithPackage("function method1(bar:int):int{\n}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("/**\n * @param {number} bar\n * @return {number}\n */\n"
+ "foo.bar.A.prototype.method1 = function(bar) {\n}");
}
@@ -73,7 +73,7 @@ public class TestGoogEmiter extends ASTe
public void testSimpleMultipleParameter()
{
IFunctionNode node = getMethodWithPackage("function method1(bar:int, baz:String, goo:A):void{\n}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("/**\n * @param {number} bar\n * @param {string} baz\n * @param {foo.bar.A} goo\n */\n"
+ "foo.bar.A.prototype.method1 = function(bar, baz, goo) {\n}");
}
@@ -82,7 +82,7 @@ public class TestGoogEmiter extends ASTe
public void testSimpleMultipleParameter_JSDoc()
{
IFunctionNode node = getMethodWithPackage("function method1(bar:int, baz:String, goo:A):void{\n}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("/**\n * @param {number} bar\n * @param {string} baz\n * @param {foo.bar.A} goo\n */\n"
+ "foo.bar.A.prototype.method1 = function(bar, baz, goo) {\n}");
}
@@ -91,7 +91,7 @@ public class TestGoogEmiter extends ASTe
public void testDefaultParameter()
{
IFunctionNode node = getMethodWithPackage("function method1(p1:int, p2:int, p3:int = 3, p4:int = 4):int{return p1 + p2 + p3 + p4;}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("/**\n * @param {number} p1\n * @param {number} p2\n * @param {number=} p3\n * @param {number=} p4\n * @return {number}\n */\n"
+ "foo.bar.A.prototype.method1 = function(p1, p2, p3, p4) {\n"
+ "\tvar self = this;\n"
@@ -104,7 +104,7 @@ public class TestGoogEmiter extends ASTe
public void testDefaultParameter_Body()
{
IFunctionNode node = getMethodWithPackage("function method1(bar:int = 42, bax:int = 4):void{if (a) foo();}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("/**\n * @param {number=} bar\n * @param {number=} bax\n */\n"
+ "foo.bar.A.prototype.method1 = function(bar, bax) {\n"
+ "\tvar self = this;\n"
@@ -117,7 +117,7 @@ public class TestGoogEmiter extends ASTe
public void testDefaultParameter_NoBody()
{
IFunctionNode node = getMethodWithPackage("function method1(p1:int, p2:int, p3:int = 3, p4:int = 4):int{}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("/**\n * @param {number} p1\n * @param {number} p2\n * @param {number=} p3\n * @param {number=} p4\n * @return {number}\n */\n"
+ "foo.bar.A.prototype.method1 = function(p1, p2, p3, p4) {\n"
+ "\tp3 = typeof p3 !== 'undefined' ? p3 : 3;\n"
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogExpressions.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogExpressions.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogExpressions.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogExpressions.java Thu Feb 28 13:53:18 2013
@@ -19,7 +19,7 @@
package org.apache.flex.compiler.internal.js.codegen.goog;
-import org.apache.flex.compiler.clients.IBackend;
+import org.apache.flex.compiler.common.driver.IBackend;
import org.apache.flex.compiler.internal.as.codegen.TestExpressions;
import org.apache.flex.compiler.internal.js.driver.goog.GoogBackend;
import org.apache.flex.compiler.internal.tree.as.NamespaceAccessExpressionNode;
@@ -40,7 +40,7 @@ public class TestGoogExpressions extends
public void testVisitLanguageIdentifierNode_SuperMethod_1()
{
IFunctionNode node = getMethod("function foo(){if (a) super.foo();}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("A.prototype.foo = function() {\n\tvar self = this;\n\tif (a)\n\t\tgoog.base(this, 'foo');\n}");
}
@@ -49,7 +49,7 @@ public class TestGoogExpressions extends
public void testVisitLanguageIdentifierNode_SuperMethod_2()
{
IFunctionNode node = getMethod("function foo(){if (a) super.foo(a, b, c);}");
- visitor.visitFunction(node);
+ asBlockWalker.visitFunction(node);
assertOut("A.prototype.foo = function() {\n\tvar self = this;\n\tif (a)\n\t\tgoog.base(this, 'foo', a, b, c);\n}");
}
@@ -66,7 +66,7 @@ public class TestGoogExpressions extends
public void testVisitBinaryOperatorNode_LogicalAndAssignment()
{
IBinaryOperatorNode node = getBinaryNode("a &&= b");
- visitor.visitBinaryOperator(node);
+ asBlockWalker.visitBinaryOperator(node);
assertOut("a = a && b");
}
@@ -75,7 +75,7 @@ public class TestGoogExpressions extends
public void testVisitBinaryOperatorNode_LogicalOrAssignment()
{
IBinaryOperatorNode node = getBinaryNode("a ||= b");
- visitor.visitBinaryOperator(node);
+ asBlockWalker.visitBinaryOperator(node);
assertOut("a = a || b");
}
@@ -89,7 +89,7 @@ public class TestGoogExpressions extends
{
IVariableNode node = (IVariableNode) getNode("var a = function(){};",
IVariableNode.class);
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("var /** @type {*} */ a = function() {\n}");
}
@@ -100,7 +100,7 @@ public class TestGoogExpressions extends
IVariableNode node = (IVariableNode) getNode(
"var a:Object = function(foo:int, bar:String = 'goo'):int{return -1;};",
IVariableNode.class);
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("var /** @type {Object} */ a = function(foo, bar) {\n\tvar self = this;\n\tbar = typeof bar !== 'undefined' ? bar : 'goo';\n\treturn -1;\n}");
}
@@ -112,7 +112,7 @@ public class TestGoogExpressions extends
IIfNode node = (IIfNode) getNode(
"if (a) {addListener('foo', function(event:Object):void{doit();});}",
IIfNode.class);
- visitor.visitIf(node);
+ asBlockWalker.visitIf(node);
assertOut("if (a) {\n\taddListener('foo', function(event) {\n\t\tvar self = this;\n\t\tdoit();\n\t});\n}");
}
@@ -121,7 +121,7 @@ public class TestGoogExpressions extends
public void testVisitAs()
{
IBinaryOperatorNode node = getBinaryNode("a as b");
- visitor.visitBinaryOperator(node);
+ asBlockWalker.visitBinaryOperator(node);
assertOut("(is(a, b) ? a : null)");
}
@@ -130,7 +130,7 @@ public class TestGoogExpressions extends
public void testVisitBinaryOperator_Instancof()
{
IBinaryOperatorNode node = getBinaryNode("a instanceof b");
- visitor.visitBinaryOperator(node);
+ asBlockWalker.visitBinaryOperator(node);
assertOut("a instanceof b");
}
@@ -139,7 +139,7 @@ public class TestGoogExpressions extends
public void testVisitBinaryOperator_Is()
{
IBinaryOperatorNode node = getBinaryNode("a is b");
- visitor.visitBinaryOperator(node);
+ asBlockWalker.visitBinaryOperator(node);
assertOut("is(a, b)");
}
@@ -151,7 +151,7 @@ public class TestGoogExpressions extends
// TODO (erikdebruin) we need a 'goog.require("a")' in the header
NamespaceAccessExpressionNode node = (NamespaceAccessExpressionNode) getExpressionNode(
"a::b", NamespaceAccessExpressionNode.class);
- visitor.visitNamespaceAccessExpression(node);
+ asBlockWalker.visitNamespaceAccessExpression(node);
assertOut("a.b");
}
@@ -163,7 +163,7 @@ public class TestGoogExpressions extends
// TODO (erikdebruin) we need a 'goog.require("a.b")' in the header
NamespaceAccessExpressionNode node = (NamespaceAccessExpressionNode) getExpressionNode(
"a::b::c", NamespaceAccessExpressionNode.class);
- visitor.visitNamespaceAccessExpression(node);
+ asBlockWalker.visitNamespaceAccessExpression(node);
assertOut("a.b.c");
}
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFieldMembers.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFieldMembers.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFieldMembers.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFieldMembers.java Thu Feb 28 13:53:18 2013
@@ -19,7 +19,7 @@
package org.apache.flex.compiler.internal.js.codegen.goog;
-import org.apache.flex.compiler.clients.IBackend;
+import org.apache.flex.compiler.common.driver.IBackend;
import org.apache.flex.compiler.internal.as.codegen.TestFieldMembers;
import org.apache.flex.compiler.internal.js.driver.goog.GoogBackend;
import org.apache.flex.compiler.tree.as.IVariableNode;
@@ -42,7 +42,7 @@ public class TestGoogFieldMembers extend
public void testField()
{
IVariableNode node = getField("var foo;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @type {*}\n */\nA.prototype.foo");
}
@@ -51,7 +51,7 @@ public class TestGoogFieldMembers extend
public void testField_withType()
{
IVariableNode node = getField("var foo:int;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @type {number}\n */\nA.prototype.foo");
}
@@ -60,7 +60,7 @@ public class TestGoogFieldMembers extend
public void testField_withTypeValue()
{
IVariableNode node = getField("var foo:int = 420;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @type {number}\n */\nA.prototype.foo = 420");
}
@@ -68,7 +68,7 @@ public class TestGoogFieldMembers extend
public void testField_withTypeValue_Negative()
{
IVariableNode node = getField("var foo:int = -420;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @type {number}\n */\nA.prototype.foo = -420");
}
@@ -77,7 +77,7 @@ public class TestGoogFieldMembers extend
public void testField_withNamespaceTypeValue()
{
IVariableNode node = getField("private var foo:int = 420;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @private\n * @type {number}\n */\nA.prototype.foo = 420");
}
@@ -86,7 +86,7 @@ public class TestGoogFieldMembers extend
public void testField_withCustomNamespaceTypeValue()
{
IVariableNode node = getField("mx_internal var foo:int = 420;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
// (erikdebruin) we ignore custom namespaces completely (are there side effects I'm missing?)
assertOut("/**\n * @type {number}\n */\nA.prototype.foo = 420");
}
@@ -96,7 +96,7 @@ public class TestGoogFieldMembers extend
public void testField_withNamespaceTypeCollection()
{
IVariableNode node = getField("protected var foo:Vector.<Foo>;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @protected\n * @type {Vector.<Foo>}\n */\nA.prototype.foo");
}
@@ -105,7 +105,7 @@ public class TestGoogFieldMembers extend
public void testField_withNamespaceTypeCollectionComplex()
{
IVariableNode node = getField("protected var foo:Vector.<Vector.<Vector.<Foo>>>;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @protected\n * @type {Vector.<Vector.<Vector.<Foo>>>}\n */\nA.prototype.foo");
}
@@ -114,7 +114,7 @@ public class TestGoogFieldMembers extend
public void testField_withNamespaceTypeValueComplex()
{
IVariableNode node = getField("protected var foo:Foo = new Foo('bar', 42);");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @protected\n * @type {Foo}\n */\nA.prototype.foo = new Foo('bar', 42)");
}
@@ -123,7 +123,7 @@ public class TestGoogFieldMembers extend
public void testField_withList()
{
IVariableNode node = getField("protected var a:int = 4, b:int = 11, c:int = 42;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @protected\n * @type {number}\n */\nA.prototype.a = 4;\n\n/**\n * @protected\n * @type {number}\n */\nA.prototype.b = 11;\n\n/**\n * @protected\n * @type {number}\n */\nA.prototype.c = 42");
}
@@ -136,7 +136,7 @@ public class TestGoogFieldMembers extend
public void testConstant()
{
IVariableNode node = getField("static const foo;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @const\n * @type {*}\n */\nA.foo");
}
@@ -144,7 +144,7 @@ public class TestGoogFieldMembers extend
public void testConstant_nonStatic()
{
IVariableNode node = getField("const foo;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @const\n * @type {*}\n */\nA.prototype.foo");
}
@@ -153,7 +153,7 @@ public class TestGoogFieldMembers extend
public void testConstant_withType()
{
IVariableNode node = getField("static const foo:int;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @const\n * @type {number}\n */\nA.foo");
}
@@ -161,7 +161,7 @@ public class TestGoogFieldMembers extend
public void testConstant_withType_nonStatic()
{
IVariableNode node = getField("const foo:int;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @const\n * @type {number}\n */\nA.prototype.foo");
}
@@ -170,7 +170,7 @@ public class TestGoogFieldMembers extend
public void testConstant_withTypeValue()
{
IVariableNode node = getField("static const foo:int = 420;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @const\n * @type {number}\n */\nA.foo = 420");
}
@@ -178,7 +178,7 @@ public class TestGoogFieldMembers extend
public void testConstant_withTypeValue_nonStatic()
{
IVariableNode node = getField("const foo:int = 420;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @const\n * @type {number}\n */\nA.prototype.foo = 420");
}
@@ -187,7 +187,7 @@ public class TestGoogFieldMembers extend
public void testConstant_withNamespaceTypeValue()
{
IVariableNode node = getField("private static const foo:int = 420;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @private\n * @const\n * @type {number}\n */\nA.foo = 420");
}
@@ -195,7 +195,7 @@ public class TestGoogFieldMembers extend
public void testConstant_withNamespaceTypeValue_nonStatic()
{
IVariableNode node = getField("private const foo:int = 420;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
assertOut("/**\n * @private\n * @const\n * @type {number}\n */\nA.prototype.foo = 420");
}
@@ -204,7 +204,7 @@ public class TestGoogFieldMembers extend
public void testConstant_withCustomNamespaceTypeValue()
{
IVariableNode node = getField("mx_internal static const foo:int = 420;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
// (erikdebruin) we ignore custom namespaces completely (are there side effects I'm missing?)
assertOut("/**\n * @const\n * @type {number}\n */\nA.foo = 420");
}
@@ -213,7 +213,7 @@ public class TestGoogFieldMembers extend
public void testConstant_withCustomNamespaceTypeValue_nonStatic()
{
IVariableNode node = getField("mx_internal const foo:int = 420;");
- visitor.visitVariable(node);
+ asBlockWalker.visitVariable(node);
// (erikdebruin) we ignore custom namespaces completely (are there side effects I'm missing?)
assertOut("/**\n * @const\n * @type {number}\n */\nA.prototype.foo = 420");
}
Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFile.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFile.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFile.java (original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/goog/TestGoogFile.java Thu Feb 28 13:53:18 2013
@@ -21,9 +21,9 @@ package org.apache.flex.compiler.interna
import java.io.File;
-import org.apache.flex.compiler.clients.IBackend;
+import org.apache.flex.compiler.common.driver.IBackend;
import org.apache.flex.compiler.internal.js.driver.goog.GoogBackend;
-import org.apache.flex.compiler.test.ASTestBase;
+import org.apache.flex.compiler.internal.test.ASTestBase;
import org.apache.flex.compiler.tree.as.IFileNode;
import org.junit.Test;
@@ -40,7 +40,7 @@ public class TestGoogFile extends ASTest
{
IFileNode node = compileAS("input", true, "goog"
+ File.separator + "files");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut(getCodeFromFile("output", true, "goog"
+ File.separator + "files"));
}
@@ -50,7 +50,7 @@ public class TestGoogFile extends ASTest
{
IFileNode node = compileAS("get-set", true, "goog"
+ File.separator + "files");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut(getCodeFromFile("get-set_result", true, "goog"
+ File.separator + "files"));
}
@@ -60,7 +60,7 @@ public class TestGoogFile extends ASTest
{
IFileNode node = compileAS("call-super", true, "goog"
+ File.separator + "files");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut(getCodeFromFile("call-super_result", true, "goog"
+ File.separator + "files"));
}
@@ -70,7 +70,7 @@ public class TestGoogFile extends ASTest
{
IFileNode node = compileAS("qualify-new-object", true, "goog"
+ File.separator + "files");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut(getCodeFromFile("qualify-new-object_result", true, "goog"
+ File.separator + "files"));
}
@@ -80,7 +80,7 @@ public class TestGoogFile extends ASTest
{
IFileNode node = compileAS("poc", true, "goog"
+ File.separator + "files");
- visitor.visitFile(node);
+ asBlockWalker.visitFile(node);
assertOut(getCodeFromFile("poc_result", true, "goog"
+ File.separator + "files"));
}