flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik de Bruin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-33887) "super" not converted to goog.base call when used in customer setter
Date Thu, 14 Nov 2013 09:33:31 GMT

    [ https://issues.apache.org/jira/browse/FLEX-33887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13822274#comment-13822274
] 

Erik de Bruin commented on FLEX-33887:
--------------------------------------

This:

{code}
package
{
  import Super;

  public class Base extends Super
  {
    public function Base() 
    {
      super();
    }; 

    override public function get text():String 
    {
      return "A" + super.text;
    };
  
    override public function set text(value:String):void 
    {
      if (value != super.text)
      {
        super.text = "B" + value;
      }
    };
  }
}
{code}

Now correctly translates to this:

{code}
goog.provide('Base');

goog.require('Super');
goog.require('org.apache.flex.utils.Language');



/**
 * @constructor
 * @extends {Super}
 */
Base = function() {
  goog.base(this);
};
goog.inherits(Base, Super);


/**
 * @expose
 * @return {string}
 * @override
 */
Base.prototype.get_text = function() {
  return "A" + goog.base(this, 'get_text');
};


/**
 * @expose
 * @param {string} value
 * @override
 */
Base.prototype.set_text = function(value) {
  if (value != goog.base(this, 'get_text')) {
    goog.base(this, 'set_text', "B" + value);
  }
};
{code}

Are there any use cases not covered?

> "super" not converted to goog.base call when used in customer setter
> --------------------------------------------------------------------
>
>                 Key: FLEX-33887
>                 URL: https://issues.apache.org/jira/browse/FLEX-33887
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: FlexJS
>         Environment: Mac OS X
>            Reporter: Peter Ent
>            Assignee: Erik de Bruin
>              Labels: compiler
>
> I created a custom ActionScript class extending org.apache.flex.html.staticControls.supportClasses.DataItemRenderer.
> I added an override to the data setter function:
> override public function set data(value:Object):void
> {
>     super.data = value;
> ...
> }
> When this class was compiled into JavaScript, the super.data=value statement produced
the following error:
> ListsTests/bin/js-debug/products/ProductItemRenderer.js:54: ERROR - Parse error. identifier
is a reserved word
> 	super.set_data(value);



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message