I'm not sure whether all these check could be passed, as I assume strk
is working on this.
On 4/28/07, Zou Lunkai <address@hidden> wrote:
> CVSROOT: /sources/gnash
> Module name: gnash
> Changes by: Zou Lunkai <zoulunkai> 07/04/28 08:03:08
>
> Modified files:
> . : ChangeLog
> testsuite/actionscript.all: with.as
>
> Log message:
> more tests about ActionWith
>
> CVSWeb URLs:
>
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3029&r2=1.3030
>
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/with.as?cvsroot=gnash&r1=1.9&r2=1.10
>
> Patches:
> Index: ChangeLog
> ===================================================================
> RCS file: /sources/gnash/gnash/ChangeLog,v
> retrieving revision 1.3029
> retrieving revision 1.3030
> diff -u -b -r1.3029 -r1.3030
> --- ChangeLog 28 Apr 2007 07:22:43 -0000 1.3029
> +++ ChangeLog 28 Apr 2007 08:03:08 -0000 1.3030
> @@ -1,3 +1,8 @@
> +2007-04-28 Zou Lunkai <address@hidden>
> +
> + * testsuite/actionscript.all/with.as:
> + add more tests
> +
> 2007-04-28 Sandro Santilli <address@hidden>
>
> * server/as_environment.{cpp,h}: stop descending
>
> Index: testsuite/actionscript.all/with.as
> ===================================================================
> RCS file: /sources/gnash/gnash/testsuite/actionscript.all/with.as,v
> retrieving revision 1.9
> retrieving revision 1.10
> diff -u -b -r1.9 -r1.10
> --- testsuite/actionscript.all/with.as 6 Mar 2007 10:16:04 -0000 1.9
> +++ testsuite/actionscript.all/with.as 28 Apr 2007 08:03:08 -0000 1.10
> @@ -22,7 +22,7 @@
> // compile this test case with Ming makeswf, and then
> // execute it like this gnash -1 -r 0 -v out.swf
>
> -rcsid="$Id: with.as,v 1.9 2007/03/06 10:16:04 strk Exp $";
> +rcsid="$Id: with.as,v 1.10 2007/04/28 08:03:08 zoulunkai Exp $";
>
> #include "check.as"
>
> @@ -124,3 +124,82 @@
>
> with(_root) { ; }
> // not aborting is enough to pass this test
> +
> +
> +
> +//---------------------------------------------------------
> +// tests how "with" affect the serch path(ScopeChain).
> +//---------------------------------------------------------
> +
> +a = 100;
> +b = 100;
> +_root.createEmptyMovieClip("mc1", 3);
> +mc1.a = 1;
> +mc1.b = 1;
> +mc1.x = 3;
> +_root.createEmptyMovieClip("mc2", 4);
> +mc2.a = 2;
> +mc2.b = 2;
> +mc2.y = 3;
> +
> +with(mc1)
> +{
> + check_equals(a, 1);
> +}
> +with(mc2)
> +{
> + check_equals(a, 2);
> +}
> +
> +with(mc1)
> +{
> + with(mc2)
> + {
> + check_equals(a, 2);
> + check_equals(b, 2);
> + check_equals(x, 3);
> + check_equals(y, 3);
> + }
> +}
> +
> +with(mc2)
> +{
> + with(mc1)
> + {
> + check_equals(a, 1);
> + check_equals(b, 1);
> + check_equals(x, 3);
> + check_equals(y, 3);
> + }
> +}
> +
> +function f_a()
> +{
> + return a;
> +}
> +
> +function f_b()
> +{
> + return b;
> +}
> +
> +function f_x()
> +{
> + return x;
> +}
> +
> +function f_y()
> +{
> + return y;
> +}
> +
> +with(mc1)
> +{
> + with(mc2)
> + {
> + check_equals(f_a(), 100);
> + check_equals(f_b(), 100);
> + check_equals(typeof(f_x()), 'undefined');
> + check_equals(typeof(f_y()), 'undefined');
> + }
> +}
>
>
> _______________________________________________
> Gnash-commit mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gnash-commit
>