Package org.apache.flex.compiler.tree.as

Examples of org.apache.flex.compiler.tree.as.IIfNode


    @Override
    @Test
    public void testVisitIf_1a()
    {
        IIfNode node = (IIfNode) getNode("if (a) { b++; }", IIfNode.class);
        asBlockWalker.visitIf(node);
        assertOut("if (a) {\n  b++;\n}");
    }
View Full Code Here


    @Override
    @Test
    public void testVisitIf_1b()
    {
        IIfNode node = (IIfNode) getNode("if (a) { b++; } else { c++; }",
                IIfNode.class);
        asBlockWalker.visitIf(node);
        assertOut("if (a) {\n  b++;\n} else {\n  c++;\n}");
    }
View Full Code Here

    @Override
    @Test
    public void testVisitIf_1c()
    {
        IIfNode node = (IIfNode) getNode(
                "if (a) { b++; } else if (b) { c++; } else { d++; }",
                IIfNode.class);
        asBlockWalker.visitIf(node);
        assertOut("if (a) {\n  b++;\n} else if (b) {\n  c++;\n} else {\n  d++;\n}");
    }
View Full Code Here

    @Override
    @Test
    public void testVisitIf_3()
    {
        IIfNode node = (IIfNode) getNode(
                "if (a) b++; else if (c) d++; else --e;", IIfNode.class);
        asBlockWalker.visitIf(node);
        assertOut("if (a)\n  b++;\nelse if (c)\n  d++;\nelse\n  --e;");
    }
View Full Code Here

    @Override
    @Test
    public void testAnonymousFunctionAsArgument()
    {
        // TODO (mschmalle) using IIfNode in expressions test, any other way to do this without statement?
        IIfNode node = (IIfNode) getNode(
                "if (a) {addListener('foo', function(event:Object):void{doit();});}",
                IIfNode.class);
        visitor.visitIf(node);
        assertOut("if (a) {\n\taddListener('foo', function(event) {\n\t\tdoit();\n\t});\n}");
    }
View Full Code Here

    @Test
    public void testAnonymousFunctionAsArgument()
    {
        // TODO (mschmalle) using IIfNode in expressions test, any other way to do this without statement?
        IIfNode node = (IIfNode) getNode(
                "if (a) {addListener('foo', function(event:Object):void{doit();});}",
                IIfNode.class);
        visitor.visitIf(node);
        assertOut("if (a) {\n\taddListener('foo', function(event:Object):void {\n\t\tdoit();\n\t});\n}");
    }
View Full Code Here

    //----------------------------------

    @Test
    public void testVisitIf_1()
    {
        IIfNode node = (IIfNode) getNode("if (a) b++;", IIfNode.class);
        visitor.visitIf(node);
        assertOut("if (a)\n\tb++;");
    }
View Full Code Here

    }

    @Test
    public void testVisitIf_2()
    {
        IIfNode node = (IIfNode) getNode("if (a) b++; else c++;", IIfNode.class);
        visitor.visitIf(node);
        assertOut("if (a)\n\tb++;\nelse\n\tc++;");
    }
View Full Code Here

    }

    @Test
    public void testVisitIf_4()
    {
        IIfNode node = (IIfNode) getNode(
                "if (a) b++; else if (c) d++; else if(e) --f;", IIfNode.class);
        visitor.visitIf(node);
        assertOut("if (a)\n\tb++;\nelse if (c)\n\td++;\nelse if (e)\n\t--f;");
    }
View Full Code Here

    //----------------------------------

    @Test
    public void testVisitIf_1a()
    {
        IIfNode node = (IIfNode) getNode("if (a) { b++; }", IIfNode.class);
        visitor.visitIf(node);
        assertOut("if (a) {\n\tb++;\n}");
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.tree.as.IIfNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.