[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash/testsuite/actionscript.all with.as
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash/testsuite/actionscript.all with.as |
Date: |
Thu, 11 Oct 2007 22:47:45 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/10/11 22:47:45
Modified files:
testsuite/actionscript.all: with.as
Log message:
Finally handled to expose the gnash bug with set_variable order (should
be: with, locals, scope)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/with.as?cvsroot=gnash&r1=1.23&r2=1.24
Patches:
Index: with.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/with.as,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- with.as 11 Oct 2007 22:07:33 -0000 1.23
+++ with.as 11 Oct 2007 22:47:45 -0000 1.24
@@ -21,7 +21,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.23 2007/10/11 22:07:33 strk Exp $";
+rcsid="$Id: with.as,v 1.24 2007/10/11 22:47:45 strk Exp $";
#include "check.as"
@@ -329,15 +329,36 @@
{
var a = 1;
var b = 6;
+ var c = "empty";
+ var f = "empty";
+
with (o)
{
+ //// GETTING VARIABLES
+
// with stack takes precedence over locals
+ // (this is o.a)
check_equals(a, 4);
// locals take precedence over scope stack
+ // (o.b does not exist)
check_equals(b, 6);
+
+ //// SETTING VARIABLES
+
+ // with stack takes precedence over locals:
+ // locals are only set if with stack don't contain the variable
being set
+ c = "with o"; // c exists in locals:YES with:NO
+ d = "with o"; // d exists in locals:NO with:NO
+ e = "with o"; // e exists in locals:NO with:YES
+ f = "with o"; // f exists in locals:YES with:YES
}
+ check_equals(c, "with o");
+ check_equals(d, "with o");
+ check_equals(typeof(e), "undefined");
+ xcheck_equals(f, "empty"); // gnash fails by giving precedence to
locals when setting the variable in 'with' context
+
_root.newFunc = function()
{
var b = 7;
@@ -360,9 +381,15 @@
o = new Object();
o.a = 4;
+o.e = "o.e";
+o.f = "o.f";
a = 120;
b = 5;
testWith();
+check_equals(typeof(o.c), 'undefined');
+check_equals(typeof(o.d), 'undefined');
+check_equals(o.e, 'with o');
+xcheck_equals(o.f, 'with o'); // gnash fails by giving precedence to locals
when setting the variable in 'with' context
newFunc();
//---------------------------------------------------------
@@ -370,7 +397,7 @@
//---------------------------------------------------------
#if OUTPUT_VERSION < 6
- check_totals(30);
+ check_totals(38);
#else
- check_totals(59);
+ check_totals(67);
#endif
- [Gnash-commit] gnash/testsuite/actionscript.all with.as, Sandro Santilli, 2007/10/11
- [Gnash-commit] gnash/testsuite/actionscript.all with.as,
Sandro Santilli <=
- [Gnash-commit] gnash/testsuite/actionscript.all with.as, Sandro Santilli, 2007/10/11
- [Gnash-commit] gnash/testsuite/actionscript.all with.as, Sandro Santilli, 2007/10/11
- [Gnash-commit] gnash/testsuite/actionscript.all with.as, Sandro Santilli, 2007/10/23
- [Gnash-commit] gnash/testsuite/actionscript.all with.as, Sandro Santilli, 2007/10/23
- [Gnash-commit] gnash/testsuite/actionscript.all with.as, Sandro Santilli, 2007/10/26