[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-commit] gnash/testsuite/actionscript.all Object.as
From: |
zou lunkai |
Subject: |
Re: [Gnash-commit] gnash/testsuite/actionscript.all Object.as |
Date: |
Tue, 8 Apr 2008 15:39:10 +0800 |
> > I bet this is not the general way to use a getter. It's easy to cause
> > recursions in swf7 and above. More general code would be:
> > (1)
> > simple_test_getter = function() { return test; };
>
> 'test' wouldn't necessarely look in 'this' first, right ?
>
Right. But the above demo might be used in the class context:
Class foo
{
var test;
simple_test_getter = function() { return test; };
}
> > (2)
> > simple_test_getter = function() { return this.test_cache; };
>
> Well, there seem to be a cache anyway, not causing recursion in SWF6,
> we want to be compatible...
>
This demo would not cause any recursion from swf6~8. And it's an
example extracted from coding books. So I guess that's the recommended
coding style, and reflects how people uses getter-setter.
BTW, the recursion limit is more 4000 here! That means for
Object-v7/8.swf in our testsuite, there are thousands of getter setter
invoked. Just hope you have awared this:)
--zou
On 4/8/08, Sandro Santilli <address@hidden> wrote:
> On Tue, Apr 08, 2008 at 11:49:21AM +0800, zou lunkai wrote:
> > hmm, many of the 'getter setter' related tests in Object.as are a bit
> > insane, unless they are all aimed at testing recursion. (But we don't
> > need that much, that would make our 'make check' even slower:) )
>
> I was tracking failures in swfdec testsuite.
> I belive one of the things slowing down 'make check' is gnash startup
> initialization time.
> See http://wiki.gnashdev.org/Initialization#Performance
>
> > > +simple_test_getter = function() { return this.test; };
> > > +o = {};
> > > +o.addProperty("test", simple_test_getter, noset_setter);
> >
> > I bet this is not the general way to use a getter. It's easy to cause
> > recursions in swf7 and above. More general code would be:
> > (1)
> > simple_test_getter = function() { return test; };
>
> 'test' wouldn't necessarely look in 'this' first, right ?
>
> > (2)
> > simple_test_getter = function() { return this.test_cache; };
>
> Well, there seem to be a cache anyway, not causing recursion in SWF6,
> we want to be compatible...
>
> > BTW, we know there is a global 'o' in _global, so not using 'o' as an
> > object name in our test should be safer.
>
> Ouch, didn't think about this, can you rename those 'o' ?
>
> --strk;
>
- [Gnash-commit] gnash/testsuite/actionscript.all Object.as, Zou Lunkai, 2008/04/01
- [Gnash-commit] gnash/testsuite/actionscript.all Object.as, Zou Lunkai, 2008/04/01
- [Gnash-commit] gnash/testsuite/actionscript.all Object.as, Sandro Santilli, 2008/04/03
- [Gnash-commit] gnash/testsuite/actionscript.all Object.as, Sandro Santilli, 2008/04/07
- Re: [Gnash-commit] gnash/testsuite/actionscript.all Object.as, zou lunkai, 2008/04/07
- Re: [Gnash-commit] gnash/testsuite/actionscript.all Object.as, zou lunkai, 2008/04/07
- Re: [Gnash-commit] gnash/testsuite/actionscript.all Object.as, Sandro Santilli, 2008/04/08
- Re: [Gnash-commit] gnash/testsuite/actionscript.all Object.as,
zou lunkai <=
- Re: [Gnash-commit] gnash/testsuite/actionscript.all Object.as, Sandro Santilli, 2008/04/08
- Re: [Gnash-commit] gnash/testsuite/actionscript.all Object.as, zou lunkai, 2008/04/08
- Re: [Gnash-commit] gnash/testsuite/actionscript.all Object.as, strk, 2008/04/08
- Re: [Gnash-commit] gnash/testsuite/actionscript.all Object.as, zou lunkai, 2008/04/08
- Re: [Gnash-commit] gnash/testsuite/actionscript.all Object.as, strk, 2008/04/08
[Gnash-commit] gnash/testsuite/actionscript.all Object.as, Zou Lunkai, 2008/04/09
[Gnash-commit] gnash/testsuite/actionscript.all Object.as, Benjamin Wolsey, 2008/04/28