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

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


    }
   
    protected IFunctionNode getMethodWithPackage(String code)
    {
        String source = "package foo.bar {public class A {" + code + "}}";
        IFileNode node = getFileNode(source);
        IFunctionNode child = (IFunctionNode) findFirstDescendantOfType(node,
                IFunctionNode.class);
        return child;
    }
View Full Code Here


    protected IUnaryOperatorNode getUnaryNode(String code)
    {
        String source = "package {public class A {function a():void {" + code
                + "}}";
        IFileNode node = getFileNode(source);
        IUnaryOperatorNode child = (IUnaryOperatorNode) findFirstDescendantOfType(
                node, IUnaryOperatorNode.class);
        return child;
    }
View Full Code Here

{
    @Override
    @Test
    public void testPackage_Simple()
    {
        IFileNode node = getFileNode("package{}");
        visitor.visitFile(node);
        assertOut("");
    }
View Full Code Here

    @Override
    @Test
    public void testPackage_Name()
    {
        IFileNode node = getFileNode("package foo.bar.baz {}");
        visitor.visitFile(node);
        assertOut("");
    }
View Full Code Here

     
      // (erikdebruin) the constuctor IS the class definition, in 'goog' JS,
      //               therefor we need to write out implicit constructors
      //               (if I understand the term correctly)
     
        IFileNode node = getFileNode("package {public class A{}}");
        visitor.visitFile(node);
        assertOut("goog.provide('A');\n\n/**\n * @constructor\n */\nA = function() {\n};");
    }
View Full Code Here

    @Override
    @Test
    public void testPackageQualified_Class()
    {
        IFileNode node = getFileNode("package foo.bar.baz {public class A{}}");
        visitor.visitFile(node);
        assertOut("goog.provide('foo.bar.baz.A');\n\n/**\n * @constructor\n */\nfoo.bar.baz.A = function() {\n};");
    }
View Full Code Here

    @Override
    @Test
    public void testPackageQualified_ClassBody()
    {
        IFileNode node = getFileNode("package foo.bar.baz {public class A{public function A(){}}}");
        visitor.visitFile(node);
        assertOut("goog.provide('foo.bar.baz.A');\n\n/**\n * @constructor\n */\nfoo.bar.baz.A = function() {\n};");
    }
View Full Code Here

    @Override
    @Test
    public void testPackageQualified_ClassBodyMethodContents()
    {
        IFileNode node = getFileNode("package foo.bar.baz {public class A{public function A(){if (a){for (var i:Object in obj){doit();}}}}}");
        visitor.visitFile(node);
        assertOut("goog.provide('foo.bar.baz.A');\n\n/**\n * @constructor\n */\nfoo.bar.baz.A = function() {\n\tif (a) {\n\t\tfor (var /** @type {Object} */ i in obj) {\n\t\t\tdoit();\n\t\t}\n\t}\n};");
    }
View Full Code Here

public class TestGoogFile extends TestWalkerBase
{
    @Test
    public void testFile_1()
    {
        IFileNode node = getFileNode("input", true);
        visitor.visitFile(node);
        assertOut(getCodeFromFile("output", true));
    }
View Full Code Here

                + "public function MyTextButton() {if (foo() != 42) { bar(); } }"
                + "private var _privateVar:String = \"do \";"
                + "public var publicProperty:Number = 100;"
                + "public function myFunction(value: String): String{"
                + "return \"Don't \" + _privateVar + value; }";
        IFileNode node = getFileNode(code);
        visitor.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\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\treturn \"Don't \" + _privateVar + value;\n};");
    }
View Full Code Here

TOP

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

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.