You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Nimai <ni...@beecavegames.com> on 2016/04/05 05:06:48 UTC
Re: [FalconJX][FlexJS] Local Functions code gen
I hope it's OK etiquette to add onto this old thread, but it appears related
to this issue. Please see the source AS3 and resulting JS below. The
"self" var is emitted but not used. If I manually add "self." in front of
the reference to "bar", it does work!
///// ACTIONSCRIPT /////
package {
public class foo {
internal var bar:String = "baz";
public function foo() {
function localFunction(i:int) {
if (i==0) {
trace( bar );
}
}
localFunction(0);
}
}
}
///// JAVASCRIPT /////
foo = function() {
var self = this;
function localFunction(i) {
if (i == 0) {
org.apache.flex.utils.Language.trace(bar); // Uncaught ReferenceError:
bar is not defined
}
};
localFunction(0);
};
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FalconJX-FlexJS-Local-Functions-code-gen-tp24890p52183.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
Re: [FalconJX][FlexJS] Local Functions code gen
Posted by Nimai <ni...@beecavegames.com>.
Shoot! That "internal" was just a leftover from my last test. Same thing
happens with "public", though.
In any case, I will at least add to JIRA. We are becoming more familiar
with the compiler code each day, with the hope to be submitting patches and
test cases for sure.
Thank you.
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FalconJX-FlexJS-Local-Functions-code-gen-tp24890p52186.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
Re: [FalconJX][FlexJS] Local Functions code gen
Posted by Alex Harui <ah...@adobe.com>.
I'm pretty sure we haven't deal with "internal" keyword yet.
Patches are welcome, or file a JIRA issue?
Thanks,
-Alex
On 4/4/16, 8:06 PM, "Nimai" <ni...@beecavegames.com> wrote:
>I hope it's OK etiquette to add onto this old thread, but it appears
>related
>to this issue. Please see the source AS3 and resulting JS below. The
>"self" var is emitted but not used. If I manually add "self." in front of
>the reference to "bar", it does work!
>
>
>///// ACTIONSCRIPT /////
>
>package {
>public class foo {
> internal var bar:String = "baz";
> public function foo() {
>
> function localFunction(i:int) {
> if (i==0) {
> trace( bar );
> }
> }
>
> localFunction(0);
> }
>}
>}
>
>
>///// JAVASCRIPT /////
>
>foo = function() {
> var self = this;
> function localFunction(i) {
> if (i == 0) {
> org.apache.flex.utils.Language.trace(bar); // Uncaught
>ReferenceError:
>bar is not defined
> }
> };
> localFunction(0);
>};
>
>
>
>
>
>--
>View this message in context:
>http://apache-flex-development.2333347.n4.nabble.com/FalconJX-FlexJS-Local
>-Functions-code-gen-tp24890p52183.html
>Sent from the Apache Flex Development mailing list archive at Nabble.com.