X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=lib%2Fas3%2Fok%2Fextends.as;fp=lib%2Fas3%2Fok%2Fextends.as;h=0ad7a49bed479ef4e98d0014f453e430bd05edcc;hb=a43e097bc7958c5739ef3e77cdcedd56ddc060b9;hp=0000000000000000000000000000000000000000;hpb=a5b0a0bab5c721e9d0771d840947d7a0625e26d3;p=swftools.git diff --git a/lib/as3/ok/extends.as b/lib/as3/ok/extends.as new file mode 100644 index 0000000..0ad7a49 --- /dev/null +++ b/lib/as3/ok/extends.as @@ -0,0 +1,38 @@ +package p { + internal class C { + private function e() { + trace("err"); + } + protected function f() { + trace("ok 1/5"); + } + } + public class D extends C { + protected function e() { + } + override protected function f() { + super.f() + } + } +} +package { + public class X extends p.D { + function X() { + super.e(); + f() + } + } + import flash.display.MovieClip + public class Main extends flash.display.MovieClip { + function Main() { + var x = new X + + import p.D + /* not sure what the difference between "is" and "instanceof" actually is */ + if(x is X) trace("ok 2/5"); + if(x is D) trace("ok 3/5"); + if(x instanceof X) trace("ok 4/5"); + if(x instanceof D) trace("ok 5/5"); + } + } +}