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

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


{
    @Override
    @Test
    public void testGetAccessor()
    {
        IGetterNode node = (IGetterNode) getAccessor("function get foo():int{}");
        asBlockWalker.visitGetter(node);
        assertOut("/**\n * @return {number}\n */\nFalconTest_A.prototype.get_foo = function() {\n}");
    }
View Full Code Here


    @Override
    @Test
    public void testGetAccessor_withBody()
    {
        IGetterNode node = (IGetterNode) getAccessor("function get foo():int{return -1;}");
        asBlockWalker.visitGetter(node);
        assertOut("/**\n * @return {number}\n */\nFalconTest_A.prototype.get_foo = function() {\n  return -1;\n}");
    }
View Full Code Here

    @Override
    @Test
    public void testGetAccessor_withNamespace()
    {
        IGetterNode node = (IGetterNode) getAccessor("public function get foo():int{return -1;}");
        asBlockWalker.visitGetter(node);
        assertOut("/**\n * @expose\n * @return {number}\n */\nFalconTest_A.prototype.get_foo = function() {\n  return -1;\n}");
    }
View Full Code Here

    @Override
    @Test
    public void testGetAccessor_withNamespaceOverride()
    {
        IGetterNode node = (IGetterNode) getAccessor("public override function get foo():int{super.foo(); return -1;}");
        asBlockWalker.visitGetter(node);
        assertOut("/**\n * @expose\n * @return {number}\n * @override\n */\nFalconTest_A.prototype.get_foo = function() {\n  FalconTest_A.base(this, 'get_foo');\n  return -1;\n}");
    }
View Full Code Here

    @Override
    @Test
    public void testGetAccessor_withStatic()
    {
        IGetterNode node = (IGetterNode) getAccessor("public static function get foo():int{return -1;}");
        asBlockWalker.visitGetter(node);
        assertOut("/**\n * @expose\n * @return {number}\n */\nFalconTest_A.get_foo = function() {\n  return -1;\n}");
    }
View Full Code Here

    }

    @Test
    public void test_get_msg()
    {
        IGetterNode node = findGetter("msg", classNode);
        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}");
    }
View Full Code Here

{
    @Override
    @Test
    public void testGetAccessor()
    {
        IGetterNode node = (IGetterNode) getAccessor("function get foo():int{}");
        asBlockWalker.visitGetter(node);
        assertOut("Object.defineProperty(\n\tFalconTest_A.prototype, \n\t'foo', "
                + "\n\t{get:function() {\n\t}, configurable:true}\n)");
    }
View Full Code Here

    }

    @Test
    public void testGetAccessor_withBody()
    {
        IGetterNode node = (IGetterNode) getAccessor("function get foo():int{return -1;}");
        asBlockWalker.visitGetter(node);
        assertOut("Object.defineProperty(\n\tFalconTest_A.prototype, \n\t'foo', "
                + "\n\t{get:function() {\n\t\tvar self = this;\n\t\treturn -1;\n\t}, configurable:true}\n)");
    }
View Full Code Here

    @Override
    @Test
    public void testGetAccessor_withNamespace()
    {
        IGetterNode node = (IGetterNode) getAccessor("public function get foo():int{return -1;}");
        asBlockWalker.visitGetter(node);
        assertOut("Object.defineProperty(\n\tFalconTest_A.prototype, \n\t'foo', "
                + "\n\t{get:function() {\n\t\tvar self = this;\n\t\treturn -1;\n\t}, configurable:true}\n)");
    }
View Full Code Here

    public void testGetAccessor_withNamespaceOverride()
    {
        // TODO (erikdebruin) need to figure out how to handle calls to
        //                    '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;}");
        asBlockWalker.visitGetter(node);
        assertOut("Object.defineProperty(\n\tFalconTest_A.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)");
    }
View Full Code Here

TOP

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

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.