You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2019/02/05 00:31:18 UTC

[GitHub] joshtynjala opened a new issue #76: Named local functions inside method in MXML not emitted in JS

joshtynjala opened a new issue #76: Named local functions inside method in MXML not emitted in JS
URL: https://github.com/apache/royale-compiler/issues/76
 
 
   ## Code to reproduce
   
   In MXML script block:
   
   ``` actionscript
   private function methodWithLocalInMXML():void {
   	function a(foo:int):void {};
   	a(123);
   }
   ```
   
   ## Actual output
   
   ``` js
   MainView.prototype.MainView_methodWithLocalInMXML = function() {
     this.a(123);
   };
   ```
   
   ## Expected output
   
   ```js
   MainView.prototype.MainView_methodWithLocalInMXML = function() {
     var self = this;
     function a(foo) {
     };
     a(123);
   };
   ```
   
   ## Other notes
   
   * Works correctly in ActionScript classes, but not in MXML.
   * This form is emitted correctly:
       ```actionscript
       var a = function(foo:int):void {};
       ```
   * Commit f0ebbf0ca473a6938cb05f86b40d7053abab3014 is where local functions started being saved in FunctionNode and emitted at the top of the parent function.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services