[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-commit] gnash ChangeLog libbase/string_table.cpp libbas...
From: |
zou lunkai |
Subject: |
Re: [Gnash-commit] gnash ChangeLog libbase/string_table.cpp libbas... |
Date: |
Thu, 25 Oct 2007 09:29:45 +0800 |
> -- Is the property in B completely masked, or only for Setter?
C = new Object();
B = new Object(); B.__proto__ = C;
A = new Object(); A.__proto__ = B;
mGetter = function() {
return this._m
};
mSetter = function (x) {
check(this == _root.A);
};
B.m = 100;
C.addProperty("m", mGetter, mSetter);
check(C.hasOwnProperty('m'));
check(B.hasOwnProperty('m'));
check(! A.hasOwnProperty('m'));
A.m = 1; // trigger the setter, got 4 checks in total.
d = A.m;
trace(d); // expect 100 (B.m)
--zou
On 10/24/07, Chad Musick <address@hidden> wrote:
> What is the result of the following change to the code?
>
> mGetter = function() {
> check(this == _root.A);
> };
>
> ...
>
> d:Number = A.m
>
>
> -- Is the property in B completely masked, or only for Setter?
>
> On Wed, 2007-10-24 at 10:36 +0800, zou lunkai wrote:
> > > > class A : B : C
> > > >
> > > > C.m is a getter-setter
> > > > B.m is a normal property
> > > > A.m doesn't exist
> > > >
> > > > When setting A.m, the getter-setter should be invoked.
> >
> > Tried the above tests, confrimed that the setter should be invoked.
> > See testing code below:
> >
> > C = new Object();
> > B = new Object(); B.__proto__ = C;
> > A = new Object(); A.__proto__ = B;
> >
> > mGetter = function() {
> > return this._m
> > };
> > mSetter = function (x) {
> > check(this == _root.A);
> > };
> >
> > B.m = 100;
> > C.addProperty("m", mGetter, mSetter);
> >
> > check(C.hasOwnProperty('m'));
> > check(B.hasOwnProperty('m'));
> > check(! A.hasOwnProperty('m'));
> >
> > A.m = 1; // trigger the setter, got 4 checks in total.
> >
> >
> > --zou
> >
> >
> >
> > On 10/24/07, Chad Musick <address@hidden> wrote:
> > > > Chad, it seems this change broke something, see my new test in
> > > > actionscript.all/Object.as
> > > >
> > > > This is the problem:
> > > >
> > > > class A : B : C
> > > >
> > > > C.m is a getter-setter
> > > > B.m is a normal property
> > > > A.m doesn't exist
> > > >
> > > > When setting A.m, the getter-setter should be invoked.
> > > > findProperty would find B.m and return that while findGetterSetter would
> > > > find C.m.
> > > >
> > > > No idea about the new isStatic thing.
> > > >
> > > > --strk;
> > >
> > > Has this behavior been verified in the proprietary player? It's most
> > > definitely wrong for AS3, since the scope rules ensure that B.m will
> > > make C.m invisible to A -- I can put in a version test (AS2 or AS3) if
> > > this is the way that AS2 is 'supposed' to operate.
> > >
> > > Chad
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > Gnash-commit mailing list
> > > address@hidden
> > > http://lists.gnu.org/mailman/listinfo/gnash-commit
> > >
>
>