[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 09:48:53 +0800 |
> +simple_test_getter = function() { return this.test; }; <-------------[0]
> +// test setter visibility of value (multiplies * 2)
> +timetwo_test_setter = function(v) {
> + // note("timetwo_test_setter sees this.test as "+this.test);
> + this.test *= 2;
> <--------------[1]
> +};
> +o = {};
> +o.addProperty("test", simple_test_getter, timetwo_test_setter);
> +o.test = 2;
> <--------------[2]
[2] will trigger [1] , then [1] will trigger [0], then [0] will
trigger itself again and again in swf7 and above untill reaching a
limitation. (I already confirmed here)
Did you make this test intentionally? In swf6, the result seems
different. Tell me if any thing you want to make sure related to this
test, I'll follow up.
--zou
On 4/8/08, Sandro Santilli <address@hidden> wrote:
> CVSROOT: /sources/gnash
> Module name: gnash
> Changes by: Sandro Santilli <strk> 08/04/07 17:09:40
>
> Modified files:
> testsuite/actionscript.all: Object.as
>
> Log message:
> More tests for user-defined getter-setter cache value
>
> CVSWeb URLs:
> http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Object.as?cvsroot=gnash&r1=1.58&r2=1.59
>
> Patches:
> Index: Object.as
> ===================================================================
> RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Object.as,v
> retrieving revision 1.58
> retrieving revision 1.59
> diff -u -b -r1.58 -r1.59
> --- Object.as 7 Apr 2008 16:31:18 -0000 1.58
> +++ Object.as 7 Apr 2008 17:09:40 -0000 1.59
> @@ -21,7 +21,7 @@
> // execute it like this gnash -1 -r 0 -v out.swf
>
>
> -rcsid="$Id: Object.as,v 1.58 2008/04/07 16:31:18 strk Exp $";
> +rcsid="$Id: Object.as,v 1.59 2008/04/07 17:09:40 strk Exp $";
> #include "check.as"
>
> // Test things in Class Object (swf5~swf8)
> @@ -498,6 +498,36 @@
> r = o.addProperty('lundef', null, setter);
> check(!r);
>
> +// not-setting setter
> +noset_setter = function(v) { noset_setter_calls++; }; // doesn't set cache
> +simple_test_getter = function() { return this.test; };
> +o = {};
> +o.addProperty("test", simple_test_getter, noset_setter);
> +noset_setter_calls=0;
> +o.test = 2;
> +check_equals(noset_setter_calls, 1);
> +v = o.test;
> +xcheck_equals(v, 2); // did still set the cache
> +o.test = 5;
> +check_equals(noset_setter_calls, 2);
> +v = o.test;
> +xcheck_equals(v, 5);
> +
> +// test setter visibility of value (multiplies * 2)
> +timetwo_test_setter = function(v) {
> + // note("timetwo_test_setter sees this.test as "+this.test);
> + this.test *= 2;
> +};
> +o = {};
> +o.test = 1;
> +o.addProperty("test", simple_test_getter, timetwo_test_setter);
> +o.test = 2;
> +v = o.test;
> +xcheck_equals(v, 2);
> +o.test = 5;
> +v = o.test;
> +xcheck_equals(v, 5);
> +
>
> // Object.addProperty wasn't in SWF5
> #endif // OUTPUT_VERSION > 5
> @@ -747,6 +777,6 @@
> #endif
>
> #if OUTPUT_VERSION >= 6
> -totals(240);
> +totals(246);
> #endif
>
>
>
> _______________________________________________
> Gnash-commit mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gnash-commit
>
- [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 <=
- 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, 2008/04/08
- 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