Just an FYI:

The compiler renames all locals to short $n names for compactness. In debug 
mode, it concats the real name with the short name so it is easier to debug, 
but maintains the renaming semantics. 

Clearly there is a bug in the renaming logic, since the rhs of the '.' operator 
is a literal, not a variable. 

I'll get on this ASAP. 

The workaround is to use a different name for the parameter. 

On Aug 19, 2010, at 18:38, "\"Maynard Demmon\" <[email protected]> 
(JIRA)"<[email protected]> wrote:

> bad as3 code if methodname and arg name are the same when a super call is made
> ------------------------------------------------------------------------------
> 
>                 Key: LPP-9310
>                 URL: http://jira.openlaszlo.org/jira/browse/LPP-9310
>             Project: OpenLaszlo
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 5.0 (TRUNK)
>            Reporter: Maynard Demmon
>            Assignee: P T Withington
>             Fix For: 5.0 (TRUNK)
> 
> 
> [15:22] mdemmon: quick question if you have a moment
> [15:23] Max Carlson: yah
> [15:23] mdemmon: i'm getting this error
> [15:23] mdemmon: ERROR @../view/simple/SimpleFileSystemTreeNodeView.lzx≈38: 
> ReferenceError: Error #1070: Method hasSubdirs_$0 not found on 
> $lzc$class_AbstractFileSystemTreeNodeView 
> [15:23] Max Carlson: 
> http://svn.lzxpatterns.com/components/trunk/demos/house.html new components
> [15:23] mdemmon: but there is a method named hasSubdiers on that class
> [15:23] Max Carlson: hmmm
> [15:23] Max Carlson: sounds like a bug
> [15:24] mdemmon: i'm trying to call it via super.hasSubdirs from a subclass 
> of that class
> [15:24] mdemmon: maybe i'm using super wrong
> [15:24] Max Carlson: you could look at the generated AS3
> [15:24] mdemmon: is it super.hasSubdirs
> [15:24] mdemmon: or just super()
> [15:24] Max Carlson: in your tmp folder somewhere
> [15:24] Max Carlson: it will have a $lzc$class_AbstractFileSystemTreeNodeView
> [15:24] Max Carlson: file
> [15:24] mdemmon: k, i'll go find it
> [15:24] Max Carlson: when you run lzc * it dumps out the path
> [15:27] mdemmon: /* -*- file: ../view/AbstractFileSystemTreeNodeView.lzx#141 
> -*- */ 
> public function hasSubdirs (hasSubdirs_$0) { 
> /* -*- file: -*- */ 
> try { 
> /* -*- file: ../view/AbstractFileSystemTreeNodeView.lzx#142 -*- */ 
> if (!hasSubdirs_$0 && this.open) { 
> this.setAttribute("open", false) 
> }} 
> /* -*- file: -*- */ 
> catch ($lzsc$e) { 
> if ($lzsc$e is Error && $lzsc$e !== lz["$lzsc$thrownError"]) { 
> $lzsc$runtime.$reportException("../view/AbstractFileSystemTreeNodeView.lzx", 
> 141, $lzsc$e) 
> } else { 
> throw $lzsc$e 
> }}}
> [15:28] Max Carlson: well, there ya have it
> [15:28] mdemmon: and here's the subclass
> [15:28] mdemmon: /* -*- file: 
> ../view/simple/SimpleFileSystemTreeNodeView.lzx#38 -*- */ 
> public override function hasSubdirs (hasSubdirs_$0) { 
> /* -*- file: -*- */ 
> try { 
> /* -*- file: ../view/simple/SimpleFileSystemTreeNodeView.lzx#39 -*- */ 
> super.hasSubdirs_$0(hasSubdirs_$0); 
> 
> 
> 
> this.plusminus.setAttribute("visible", hasSubdirs_$0) 
> } 
> /* -*- file: -*- */ 
> catch ($lzsc$e) { 
> if ($lzsc$e is Error && $lzsc$e !== lz["$lzsc$thrownError"]) { 
> $lzsc$runtime.$reportException("../view/simple/SimpleFileSystemTreeNodeView.lzx",
>  38, $lzsc$e) 
> } else { 
> throw $lzsc$e 
> }}}
> [15:28] Max Carlson: looks like a bug to me... 
> [15:29] Max Carlson: what does the class declaration at the top look like?
> [15:29] Max Carlson: are you using a mixin?
> [15:29] mdemmon: perhaps it shouldn't be tacking on the _$0
> [15:29] mdemmon: i am
> [15:29] Max Carlson: nah, that won't matter
> [15:29] mdemmon: on the Abstract class
> [15:29] Max Carlson: okay, your mixin may need a declaration of that method.
> [15:29] mdemmon: but the mixin isn't really involved here
> [15:30] Max Carlson: so the abstract class is <class abstact with="mixin"/>
> [15:30] mdemmon: yes
> [15:30] Max Carlson: and this class is extending that one.
> [15:30] mdemmon: yes
> [15:30] Max Carlson: does the extends match in the class declaration at the 
> top of the subclass AS3 file?
> [15:30] mdemmon: <class name="AbstractFileSystemTreeNodeView" extends="view"
>     with="TreeNodeMixin" 
>> 
> [15:30] Max Carlson: extends="view" is the default, so you don't need that :)
> [15:30] mdemmon: <class name="SimpleFileSystemTreeNodeView" 
>     extends="AbstractFileSystemTreeNodeView" 
>     nodecontainer="$once{this._nc}"
>     childClassname="SimpleFileSystemTreeNodeView"
>> 
> [15:31] mdemmon: yeah, i just put it in to be clear
> [15:31] Max Carlson: kk
> [15:31] Max Carlson: and the as3 for SimpleFileSystemTreeNodeView.as3 extends 
> the correct classname?
> [15:31] mdemmon: i'll check
> [15:32] Max Carlson: e.g. AbstractFileSystemTreeNodeView
> [15:32] mdemmon: yes, the extends is the same
> [15:32] mdemmon: $lzc$class_AbstractFileSystemTreeNodeView
> [15:33] Max Carlson: hmm bizarre
> [15:33] Max Carlson: maybe Flash is fubarred?
> [15:33] mdemmon: so what is the _$0 for?
> [15:33] Max Carlson: it just says it's the first arg
> [15:33] Max Carlson: since the args may be packed in a plist format.
> [15:33] Max Carlson: does it work in debug mode?
> [15:33] mdemmon: this here seems odd to me -> 
> super.hasSubdirs_$0(hasSubdirs_$0);  
> [15:34] mdemmon: i'm in debug mode
> [15:34] mdemmon: it's trying to call the hasSubdirs_$0 method on the 
> superclass
> [15:34] mdemmon: but that is public function hasSubdirs (hasSubdirs_$0) {
> [15:35] Max Carlson: yeah, that would be the bug
> [15:35] Max Carlson: so the AS3 generator is broken
> [15:35] Max Carlson: it should say super.hasSubDirs(hasSubdirs_$0)
> [15:35] mdemmon: yup
> [15:35] Max Carlson: i would rename the argument/method name for now.
> [15:35] Max Carlson: looks like a string substitution fuckup
> [15:35] mdemmon: ic, so it's an artifact of different things named the same
> [15:36] Max Carlson: either one should work
> [15:36] Max Carlson: right
> [15:36] mdemmon: and some form of "simple" string replacement
> [15:36] Max Carlson: yup
> [15:36] Max Carlson: pls file a bug
> [15:36] Max Carlson: and note the workaround
> [15:36] Max Carlson: that's a nasty one!
> [15:36] mdemmon: k, i'll just include the body of this chat
> [15:36] Max Carlson: kk thx
> 
> -- 
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators: 
> http://jira.openlaszlo.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see: http://www.atlassian.com/software/jira
> 
> 

Reply via email to