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

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


    @Override
    @Test
    public void testVisitBinaryOperatorNode_LogicalAndAssignment()
    {
        IBinaryOperatorNode node = getBinaryNode("a &&= b");
        asBlockWalker.visitBinaryOperator(node);
        assertOut("a = a && b");
    }
View Full Code Here


    @Override
    @Test
    public void testVisitBinaryOperatorNode_LogicalOrAssignment()
    {
        IBinaryOperatorNode node = getBinaryNode("a ||= b");
        asBlockWalker.visitBinaryOperator(node);
        assertOut("a = a || b");
    }
View Full Code Here

    @Override
    @Test
    public void testVisitAs()
    {
        IBinaryOperatorNode node = getBinaryNode("a as b");
        asBlockWalker.visitBinaryOperator(node);
        assertOut("(is(a, b) ? a : null)");
    }
View Full Code Here

    @Override
    @Test
    public void testVisitBinaryOperator_Instancof()
    {
        IBinaryOperatorNode node = getBinaryNode("a instanceof b");
        asBlockWalker.visitBinaryOperator(node);
        assertOut("a instanceof b");
    }
View Full Code Here

    @Override
    @Test
    public void testVisitBinaryOperator_Is()
    {
        IBinaryOperatorNode node = getBinaryNode("a is b");
        asBlockWalker.visitBinaryOperator(node);
        assertOut("is(a, b)");
    }
View Full Code Here

    }

    @Test
    public void testGlobalFunctionInClass()
    {
        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
                "public class B {public function b():String { var s:String; s = encodeURIComponent('foo'); return s;}",
                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
        asBlockWalker.visitBinaryOperator(node);
        assertOut("s = encodeURIComponent('foo')");
    }
View Full Code Here

    }

    @Test
    public void testParentheses_3()
    {
        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
                "a = (a + b) - c + d * e;", IBinaryOperatorNode.class);
        asBlockWalker.visitBinaryOperator(node);
        assertOut("a = (a + b) - c + d * e");
    }
View Full Code Here

    }

    @Test
    public void testParentheses_4()
    {
        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
                "a = ((a + b) - (c + d)) * e;", IBinaryOperatorNode.class);
        asBlockWalker.visitBinaryOperator(node);
        assertOut("a = ((a + b) - (c + d)) * e");
    }
View Full Code Here

    }

    @Test
    public void testParentheses_Strings1()
    {
        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
                "a = '' + '' + '' + ''", IBinaryOperatorNode.class);
        asBlockWalker.visitBinaryOperator(node);
        assertOut("a = '' + '' + '' + ''");
    }
View Full Code Here

    @Test
    public void testParentheses_Strings2()
    {
        // this is a whacked test but is just proves the logic that for now,
        // we only leave out parens for String literals on the right hand side
        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
                "a = '' + 2 + '' + '' * 4 ", IBinaryOperatorNode.class);
        asBlockWalker.visitBinaryOperator(node);
        assertOut("a = '' + 2 + '' + '' * 4");
    }
View Full Code Here

TOP

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

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.