ArtemHarchishin / as3-commons

Automatically exported from code.google.com/p/as3-commons
0 stars 0 forks source link

Is the signature for getouterscope correct #62

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
f you try to use getouterscope with a multiname as the argument then it always 
fails

new Opcode( 0x67, "getouterscope", [BaseMultiname, AbcSpec.U30] )

If you instead set it to accept an int (offest onto the scope object like 
getscopeobject)

new Opcode( 0x67, "getouterscope", [int, AbcSpec.U30] )

The  it seems to do something.

I know it is undocumented, but I think we need an Op like this to do what we 
are trying to do. Where did you learn what the arguments should be? Does 
anybody know how this is supposed to work.

Thanks

Conrad

Original issue reported on code.google.com by conrad.w...@gmail.com on 10 Jul 2011 at 2:00

GoogleCodeExporter commented 9 years ago
I can definitely confirm that getouterscope behave in the following way

If I have a class B that extends A that extends Object then the outer-scope 
looks like this

global   Object$ A B  

getouterscope with 0 as the arguent returns global
getouterscope with 1 as the arguent returns Object
getouterscope with 2 as the arguent returns A
getouterscope with 3 as the arguent returns B
getouterscope with 4 as the arguent throws an out of bounds error.

Therefore, as far as I can tell, the argument type for getouterscope should be 
an int and not a multiname

Conrad

Original comment by conrad.w...@gmail.com on 11 Jul 2011 at 5:07

GoogleCodeExporter commented 9 years ago
Hey Conrad,

I have collected the information on all of the different undocumented opcodes 
from a variety of sources on the internet, mostly blog posts and stuff.
Nice catch of you on the getouterscope parameter! I have made the change and 
it's available in the trunk.

Thanks a lot for contributing!

cheers,

Roland

Original comment by ihatelivelyids on 12 Jul 2011 at 8:48