[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash/testsuite/actionscript.all setProperty.as
From: |
Zou Lunkai |
Subject: |
[Gnash-commit] gnash/testsuite/actionscript.all setProperty.as |
Date: |
Wed, 14 May 2008 08:14:27 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Zou Lunkai <zoulunkai> 08/05/14 08:14:26
Modified files:
testsuite/actionscript.all: setProperty.as
Log message:
more swf5 failures.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/setProperty.as?cvsroot=gnash&r1=1.6&r2=1.7
Patches:
Index: setProperty.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/setProperty.as,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- setProperty.as 12 May 2008 03:36:08 -0000 1.6
+++ setProperty.as 14 May 2008 08:14:25 -0000 1.7
@@ -19,7 +19,7 @@
// compile this test case with Ming makeswf, and then
// execute it like this gnash -1 -r 0 -v out.swf
-rcsid="$Id: setProperty.as,v 1.6 2008/05/12 03:36:08 zoulunkai Exp $";
+rcsid="$Id: setProperty.as,v 1.7 2008/05/14 08:14:25 zoulunkai Exp $";
#include "check.as"
#ifdef MING_SUPPORTS_ASM
@@ -127,6 +127,41 @@
check_equals(_root.checkpoint, "/");
#endif
-check_totals(9);
+//
+// Test scope chain in swf5.
+//
+// The scope chain in swf5 and below works differently, which
+// might explain why AS in swf5(and below) was so unstable. All
+// tests above can also be explained by the scope chain difference
+// in swf5.
+//
+_root.checkpoint = "var_in_root";
+createSprite("mc4", 40);
+mc4.checkpoint = "var_in_mc4";
+mc4.func = function () {
+ check_equals(this, _root.mc4);
+#if OUTPUT_VERSION == 5
+ // for swf5, mc4 is the top of the scope chain.
+ xcheck_equals(checkpoint, var_in_mc4);
+ xcheck_equals(_target, "/mc4");
+#else
+ // for swf6 and above, current target is the top of the scope chain.
+ check_equals(checkpoint, "var_in_root");
+ check_equals(_target, "/");
+#endif
+};
+mc4.func();
+
+obj.checkpoint = "var_in_obj";
+obj = new Object();
+obj.func = function () {
+ check_equals(this, obj);
+ // "this" object is not part of the scope chain for all swf versions.
+ // But if "this" is a sprite(tests right above), the situation is
different...
+ check_equals(checkpoint, "var_in_root");
+};
+obj.func();
+
+check_totals(14);
#endif //MING_SUPPORTS_ASM