gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog server/as_environment.cpp tests...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/as_environment.cpp tests...
Date: Thu, 26 Apr 2007 16:26:02 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/04/26 16:26:02

Modified files:
        .              : ChangeLog 
        server         : as_environment.cpp 
        testsuite/actionscript.all: Function.as 

Log message:
                * server/as_environment.cpp (get_variable_raw): elements of
                  the 'with' stack take precedence over locals.
                  See test in Function.as.
                * testsuite/actionscript.all/Function.as: add test for 'with'
                  stack taking precedence over locals when getting variables.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3009&r2=1.3010
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.cpp?cvsroot=gnash&r1=1.72&r2=1.73
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Function.as?cvsroot=gnash&r1=1.43&r2=1.44

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3009
retrieving revision 1.3010
diff -u -b -r1.3009 -r1.3010
--- ChangeLog   26 Apr 2007 13:44:07 -0000      1.3009
+++ ChangeLog   26 Apr 2007 16:26:01 -0000      1.3010
@@ -1,5 +1,13 @@
 2007-04-26 Sandro Santilli <address@hidden>
 
+       * server/as_environment.cpp (get_variable_raw): elements of 
+         the 'with' stack take precedence over locals.
+         See test in Function.as.
+       * testsuite/actionscript.all/Function.as: add test for 'with'
+         stack taking precedence over locals when getting variables.
+
+2007-04-26 Sandro Santilli <address@hidden>
+
        * testsuite/actionscript.all/Function.as: test for 'this' in
          local function.
        * server/as_environment.{cpp,h}: refactor local variables

Index: server/as_environment.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -b -r1.72 -r1.73
--- server/as_environment.cpp   26 Apr 2007 13:34:00 -0000      1.72
+++ server/as_environment.cpp   26 Apr 2007 16:26:01 -0000      1.73
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: as_environment.cpp,v 1.72 2007/04/26 13:34:00 strk Exp $ */
+/* $Id: as_environment.cpp,v 1.73 2007/04/26 16:26:01 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -106,13 +106,6 @@
 
     as_value   val;
 
-    // Check locals for getting them
-    //as_environment::frame_slot slot;
-    if ( findLocal(varname, val, true) ) // do we really want to descend here 
??
-    {
-       return val;
-    }
-
     // Check the with-stack.
     for (size_t i = with_stack.size(); i > 0; --i) {
         // const_cast needed due to non-const as_object::get_member 
@@ -123,6 +116,14 @@
        }
     }
 
+    // Check locals for getting them
+    //as_environment::frame_slot slot;
+    if ( findLocal(varname, val, true) ) // do we really want to descend here 
??
+    {
+       return val;
+    }
+
+
     // Check target members.
     if (m_target->get_member(varname.c_str(), &val)) {
        return val;

Index: testsuite/actionscript.all/Function.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Function.as,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- testsuite/actionscript.all/Function.as      26 Apr 2007 13:44:07 -0000      
1.43
+++ testsuite/actionscript.all/Function.as      26 Apr 2007 16:26:02 -0000      
1.44
@@ -20,7 +20,7 @@
 // compile this test case with Ming makeswf, and then
 // execute it like this gnash -1 -r 0 -v out.swf
 
-rcsid="$Id: Function.as,v 1.43 2007/04/26 13:44:07 strk Exp $";
+rcsid="$Id: Function.as,v 1.44 2007/04/26 16:26:02 strk Exp $";
 
 #include "check.as"
 
@@ -640,17 +640,24 @@
 #endif
        xcheck(ret != this);
 
+       var num = 4;
        with(o) {
                // see bug #19704
                ret = getThis();
                xcheck_equals(typeof(ret), 'object');
                xcheck_equals(ret, o);
+
+               // 'with' stack takes precedence over locals
+               check_equals(num, 5);
        }
+       check_equals(num, 4);
 }
 
+o.num = 5;
 testInFunctionContext(o);
 
 // Quick test to verify that a movieclip is never equal to an object, despite 
it's primitive value
-o = new Object(); o.valueOf = function() { return _root; };
+o = new Object();
+o.valueOf = function() { return _root; };
 check_equals(_root, o);
 check_equals(o, _root);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]