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/09/11 15:54:09 UTC

[GitHub] [royale-compiler] joshtynjala commented on issue #90: Bad "this"

joshtynjala commented on issue #90: Bad "this"
URL: https://github.com/apache/royale-compiler/issues/90#issuecomment-530445005
 
 
   The compiler is actually working correctly, and this matches the behavior of SWF.
   
   `self` is used in the generated output only when `this` is implicit. That's why `status = "complete";` turns into `self.status = "complete"`. However, if you had `this.status = "complete";` instead, the explicit `this` would not be replaced by `self` in the generated output.
   
   Similarly, `complete(this)` turns into `self.complete(this)`. The first `this` in ActionScript is implicit, so it the JS gets `self`, and the second is explicit, so it remains as `this` in JS.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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