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 serve...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/as_environment.cpp serve...
Date: Fri, 27 Apr 2007 16:09:01 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/04/27 16:09:01

Modified files:
        .              : ChangeLog 
        server         : as_environment.cpp as_environment.h 
                         swf_function.cpp swf_function.h 
        server/vm      : ASHandlers.cpp ActionExec.cpp ActionExec.h 
        testsuite/actionscript.all: Function.as 
        testsuite/swfdec: PASSING 

Log message:
                * server/as_environment.{cpp,h}: changed the ScopeChain
                  typedef to be just a vector of as_objects.
                * server/swf_function.{cpp,h}: take a vector of as_objects
                  as ScopeChain, rather then with_entry vector...
                * server/vm/ActionExec.{cpp,h}: only expose the ScopeChain,
                  not the 'with' stack. When constructed for a function, push
                  the function's activation object to the ScopeChain.
                * server/vm/ASHandlers.cpp: update calls to ActionExec and
                  swf_function when it comes to setting the ScopeChain.
                * testsuite/actionscript.all/Function.as: the scope chain test 
kai
                  added now succeeds.
                * testsuite/swfdec/PASSING: function-scope-6.swf and 
function-scope-7.swf
                  now succeed.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3021&r2=1.3022
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.cpp?cvsroot=gnash&r1=1.74&r2=1.75
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.h?cvsroot=gnash&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf_function.cpp?cvsroot=gnash&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf_function.h?cvsroot=gnash&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.101&r2=1.102
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.cpp?cvsroot=gnash&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.h?cvsroot=gnash&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Function.as?cvsroot=gnash&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/swfdec/PASSING?cvsroot=gnash&r1=1.20&r2=1.21

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3021
retrieving revision 1.3022
diff -u -b -r1.3021 -r1.3022
--- ChangeLog   27 Apr 2007 13:01:10 -0000      1.3021
+++ ChangeLog   27 Apr 2007 16:09:00 -0000      1.3022
@@ -1,5 +1,21 @@
 2007-04-27 Sandro Santilli <address@hidden>
 
+       * server/as_environment.{cpp,h}: changed the ScopeChain
+         typedef to be just a vector of as_objects.
+       * server/swf_function.{cpp,h}: take a vector of as_objects
+         as ScopeChain, rather then with_entry vector...
+       * server/vm/ActionExec.{cpp,h}: only expose the ScopeChain,
+         not the 'with' stack. When constructed for a function, push
+         the function's activation object to the ScopeChain.
+       * server/vm/ASHandlers.cpp: update calls to ActionExec and
+         swf_function when it comes to setting the ScopeChain.
+       * testsuite/actionscript.all/Function.as: the scope chain test kai
+         added now succeeds.
+       * testsuite/swfdec/PASSING: function-scope-6.swf and 
function-scope-7.swf
+         now succeed.
+
+2007-04-27 Sandro Santilli <address@hidden>
+
        * libgeometry/snappingrange.h: add contains(SnappingRange2d) method;
          fixed contains(Range2d) to take a const ref rather then a value.
        * testsuite/libgeometry/snappingrangetest.cpp: add tests for

Index: server/as_environment.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.cpp,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -b -r1.74 -r1.75
--- server/as_environment.cpp   26 Apr 2007 17:06:10 -0000      1.74
+++ server/as_environment.cpp   27 Apr 2007 16:09:00 -0000      1.75
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: as_environment.cpp,v 1.74 2007/04/26 17:06:10 strk Exp $ */
+/* $Id: as_environment.cpp,v 1.75 2007/04/27 16:09:00 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -45,7 +45,7 @@
 // Return the value of the given var, if it's defined.
 as_value
 as_environment::get_variable(const std::string& varname,
-               const ScopeStack& with_stack, as_object** retTarget) const
+               const ScopeStack& scopeStack, as_object** retTarget) const
 {
     // Path lookup rigamarole.
     std::string        path;
@@ -53,11 +53,11 @@
     //log_msg(_("get_variable(%s)"), varname.c_str());
     bool is_slash_based;
     if (parse_path(varname, path, var, &is_slash_based)) {
-       //as_value target_val = get_variable_raw(path, with_stack);
+       //as_value target_val = get_variable_raw(path, scopeStack);
         //as_object* target = target_val.to_object();
        // TODO: let find_target return generic as_objects, or use 'with' stack,
        //       see player2.swf or bug #18758 (strip.swf)
-       // @@ TODO: should we use with_stack here too ?
+       // @@ TODO: should we use scopeStack here too ?
         as_object* target = is_slash_based ? find_object_slashsyntax(path) : 
find_object_dotsyntax(path); 
 
        if (target) {
@@ -76,31 +76,31 @@
                            );
            );
 
-           as_value tmp = get_variable_raw(path, with_stack, retTarget);
+           as_value tmp = get_variable_raw(path, scopeStack, retTarget);
            if ( ! tmp.is_undefined() )
            {
            IF_VERBOSE_ASCODING_ERRORS(
-                   log_aserror(_("...but get_variable_raw(%s, <with_stack>) 
succeeded!"), path.c_str());
+                   log_aserror(_("...but get_variable_raw(%s, <scopeStack>) 
succeeded!"), path.c_str());
            )
            }
            return as_value();
        }
     } else {
-       return get_variable_raw(varname, with_stack, retTarget);
+       return get_variable_raw(varname, scopeStack, retTarget);
     }
 }
 
 as_value
 as_environment::get_variable(const std::string& varname) const
 {
-       static ScopeStack empty_with_stack;
-       return get_variable(varname, empty_with_stack);
+       static ScopeStack empty_scopeStack;
+       return get_variable(varname, empty_scopeStack);
 }
 
 as_value
 as_environment::get_variable_raw(
     const std::string& varname,
-    const ScopeStack& with_stack, as_object** retTarget) const
+    const ScopeStack& scopeStack, as_object** retTarget) const
     // varname must be a plain variable name; no path parsing.
 {
     assert(strchr(varname.c_str(), ':') == NULL);
@@ -108,9 +108,9 @@
     as_value   val;
 
     // Check the with-stack.
-    for (size_t i = with_stack.size(); i > 0; --i) {
+    for (size_t i = scopeStack.size(); i > 0; --i) {
         // const_cast needed due to non-const as_object::get_member 
-       as_object* obj = const_cast<as_object*>(with_stack[i-1].object());
+       as_object* obj = const_cast<as_object*>(scopeStack[i-1].get());
        if (obj && obj->get_member(varname.c_str(), &val)) {
            // Found the var in this context.
            if ( retTarget ) *retTarget = obj;
@@ -174,7 +174,7 @@
 bool
 as_environment::del_variable_raw(
     const std::string& varname,
-    const ScopeStack& with_stack) 
+    const ScopeStack& scopeStack) 
     // varname must be a plain variable name; no path parsing.
 {
        assert(strchr(varname.c_str(), ':') == NULL);
@@ -184,10 +184,10 @@
        as_value        val;
 
        // Check the with-stack.
-       for (size_t i = with_stack.size(); i > 0; --i)
+       for (size_t i = scopeStack.size(); i > 0; --i)
        {
                // const_cast needed due to non-const as_object::get_member 
-               as_object* obj = 
const_cast<as_object*>(with_stack[i-1].object());
+               as_object* obj = const_cast<as_object*>(scopeStack[i-1].get());
                if (obj)
                {
                        std::pair<bool,bool> ret = obj->delProperty(varname);
@@ -221,8 +221,8 @@
 as_value
 as_environment::get_variable_raw(const std::string& varname) const
 {
-       static ScopeStack empty_with_stack;
-       return get_variable_raw(varname, empty_with_stack);
+       static ScopeStack empty_scopeStack;
+       return get_variable_raw(varname, empty_scopeStack);
 }
 
 // Given a path to variable, set its value.
@@ -230,7 +230,7 @@
 as_environment::set_variable(
     const std::string& varname,
     const as_value& val,
-    const ScopeStack& with_stack)
+    const ScopeStack& scopeStack)
 {
        IF_VERBOSE_ACTION (
     log_action("-------------- %s = %s",
@@ -259,7 +259,7 @@
                );
        }
     } else {
-       set_variable_raw(varname, val, with_stack);
+       set_variable_raw(varname, val, scopeStack);
     }
 }
 
@@ -268,8 +268,8 @@
                const std::string& varname,
                const as_value& val)
 {
-       static ScopeStack empty_with_stack;
-       set_variable(varname, val, empty_with_stack);
+       static ScopeStack empty_scopeStack;
+       set_variable(varname, val, empty_scopeStack);
 }
 
 // No path rigamarole.
@@ -277,7 +277,7 @@
 as_environment::set_variable_raw(
     const std::string& varname,
     const as_value& val,
-    const ScopeStack& with_stack)
+    const ScopeStack& scopeStack)
 {
 
        // Check locals for setting them
@@ -287,10 +287,10 @@
        }
 
        // Check the with-stack.
-       for (size_t i = with_stack.size(); i > 0; --i)
+       for (size_t i = scopeStack.size(); i > 0; --i)
        {
                // const_cast needed due to non-const as_object::get_member 
-               as_object* obj = 
const_cast<as_object*>(with_stack[i-1].object());
+               as_object* obj = const_cast<as_object*>(scopeStack[i-1].get());
                as_value        dummy;
                if (obj && obj->get_member(varname.c_str(), &dummy)) {
                    // This object has the member; so set it here.
@@ -308,8 +308,8 @@
                const std::string& varname,
                const as_value& val)
 {
-       static ScopeStack empty_with_stack;
-       set_variable_raw(varname, val, empty_with_stack);
+       static ScopeStack empty_scopeStack;
+       set_variable_raw(varname, val, empty_scopeStack);
 }
 
 // Set/initialize the value of the local variable.

Index: server/as_environment.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- server/as_environment.h     26 Apr 2007 17:06:10 -0000      1.48
+++ server/as_environment.h     27 Apr 2007 16:09:01 -0000      1.49
@@ -34,7 +34,7 @@
 
 // Forward declarations
 class character;
-class with_stack_entry;
+//class with_stack_entry;
 
 /// ActionScript execution environment.
 class as_environment
@@ -42,32 +42,12 @@
 public:
 
        /// A stack of objects used for variables/members lookup
-       typedef std::vector<with_stack_entry> ScopeStack;
+       //typedef std::vector<with_stack_entry> ScopeStack;
+       typedef std::vector< boost::intrusive_ptr<as_object> > ScopeStack;
 
        /// Stack of as_values in this environment
        std::vector<as_value>   m_stack;
 
-#if 0
-       /// For local vars.  Use empty names to separate frames.
-       class frame_slot
-       {
-       public:
-               std::string     m_name;
-               as_value        m_value;
-
-               frame_slot()
-               {
-               }
-
-               frame_slot(const std::string& name, const as_value& val)
-                       :
-                       m_name(name),
-                       m_value(val)
-               {
-               }
-       };
-#endif
-
        as_environment()
                :
                m_target(0)
@@ -160,11 +140,11 @@
        ///     Variable name. Can not contain path elements.
        ///     TODO: should be case-insensitive up to SWF6.
        ///
-       /// @param with_stack
+       /// @param scopeStack
        ///     The Scope stack to use for lookups.
        ///
        bool del_variable_raw(const std::string& varname,
-                       const ScopeStack& with_stack);
+                       const ScopeStack& scopeStack);
 
        /// Return the (possibly UNDEFINED) value of the named var.
        //
@@ -172,7 +152,7 @@
        ///     Variable name. Can contain path elements.
        ///     TODO: should be case-insensitive up to SWF6.
        ///
-       /// @param with_stack
+       /// @param scopeStack
        ///     The Scope stack to use for lookups.
        ///
        /// @param retTarget
@@ -180,7 +160,7 @@
        ///     found variable (if found).
        ///
        as_value get_variable(const std::string& varname,
-               const ScopeStack& with_stack, as_object** retTarget=NULL) const;
+               const ScopeStack& scopeStack, as_object** retTarget=NULL) const;
 
        /// \brief
        /// Given a path to variable, set its value.
@@ -227,11 +207,11 @@
        /// @param val
        ///     The value to assign to the variable.
        ///
-       /// @param with_stack
+       /// @param scopeStack
        ///     The Scope stack to use for lookups.
        ///
        void set_variable(const std::string& path, const as_value& val,
-               const ScopeStack& with_stack);
+               const ScopeStack& scopeStack);
 
        /// Set/initialize the value of the local variable.
        //
@@ -474,6 +454,14 @@
                _localFrames.pop_back();
        }
 
+       /// Get top element of the call stack
+       //
+       CallFrame& topCallFrame()
+       {
+               assert(_localFrames.size());
+               return _localFrames.back();
+       }
+
        /// Return the depth of call stack
        size_t callStackDepth()
        {
@@ -513,7 +501,7 @@
 
        /// Given a variable name, set its value (no support for path)
        void set_variable_raw(const std::string& path, const as_value& val,
-               const ScopeStack& with_stack);
+               const ScopeStack& scopeStack);
 
        /// Same of the above, but no support for path.
        ///
@@ -522,7 +510,7 @@
        ///     found variable (if found).
        ///
        as_value get_variable_raw(const std::string& varname,
-               const ScopeStack& with_stack, as_object** retTarget=NULL) const;
+               const ScopeStack& scopeStack, as_object** retTarget=NULL) const;
 
 
        /// \brief

Index: server/swf_function.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf_function.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- server/swf_function.cpp     22 Mar 2007 22:37:45 -0000      1.28
+++ server/swf_function.cpp     27 Apr 2007 16:09:01 -0000      1.29
@@ -45,13 +45,13 @@
 
 swf_function::swf_function(const action_buffer* ab,
                        as_environment* env,
-                       size_t start, const std::vector<with_stack_entry>& 
with_stack)
+                       size_t start, const ScopeStack& scopeStack)
        :
        as_function(NULL),
        //ctor(0),
        m_action_buffer(ab),
        m_env(env),
-       m_with_stack(with_stack),
+       _scopeStack(scopeStack),
        m_start_pc(start),
        m_length(0),
        m_is_function2(false),
@@ -169,6 +169,7 @@
 {
 
        as_environment* our_env = m_env;
+       assert(our_env);
        if (our_env == NULL)
        {
                our_env = &fn.env();

Index: server/swf_function.h
===================================================================
RCS file: /sources/gnash/gnash/server/swf_function.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- server/swf_function.h       11 Apr 2007 17:54:21 -0000      1.12
+++ server/swf_function.h       27 Apr 2007 16:09:01 -0000      1.13
@@ -23,7 +23,8 @@
 
 #include "impl.h"
 #include "as_function.h" // for inheritance
-#include "with_stack_entry.h" // for composition (vector element)
+#include "as_object.h" // for composition (vector element)
+//#include "with_stack_entry.h" // for composition (vector element)
 
 #include <cassert>
 #include <string>
@@ -49,8 +50,10 @@
        /// @@ might need some kind of ref count here, but beware cycles
        as_environment* m_env;
 
-       /// initial with-stack on function entry.
-       std::vector<with_stack_entry>   m_with_stack;
+       typedef std::vector< boost::intrusive_ptr<as_object> > ScopeStack;
+
+       /// Scope stack on function definition.
+       ScopeStack _scopeStack;
 
        /// \brief
        /// Offset within the action_buffer where
@@ -175,11 +178,11 @@
        swf_function(const action_buffer* ab,
                as_environment* env,
                size_t start,
-               const std::vector<with_stack_entry>& with_stack);
+               const ScopeStack& with_stack);
 
-       const std::vector<with_stack_entry>& getWithStack() const
+       const ScopeStack& getScopeStack() const
        {
-               return m_with_stack;
+               return _scopeStack;
        }
 
        const action_buffer& getActionBuffer() const

Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -b -r1.101 -r1.102
--- server/vm/ASHandlers.cpp    26 Apr 2007 17:06:10 -0000      1.101
+++ server/vm/ASHandlers.cpp    27 Apr 2007 16:09:01 -0000      1.102
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: ASHandlers.cpp,v 1.101 2007/04/26 17:06:10 strk Exp $ */
+/* $Id: ASHandlers.cpp,v 1.102 2007/04/27 16:09:01 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -3263,7 +3263,7 @@
        // contains name and args, while next tag is first tag
        // of the function body.
        swf_function* func = new swf_function(
-               &code, &env, thread.next_pc, thread.getWithStack());
+               &code, &env, thread.next_pc, thread.getScopeStack());
 
        func->set_is_function2();
 
@@ -3384,12 +3384,6 @@
        thread.ensureStack(1);  // the object
        boost::intrusive_ptr<as_object> with_obj = env.pop().to_object();
 
-       const vector<with_stack_entry>& with_stack = thread.getWithStack();
-       IF_VERBOSE_ACTION (
-       log_action(_("-------------- with block start: stack size is " 
SIZET_FMT),
-                  with_stack.size());
-       );
-
        ++pc; // skip tag code
 
        int tag_length = code.read_int16(pc); // read tag len (should be 2)
@@ -3421,11 +3415,6 @@
        if ( ! thread.pushWithEntry(with_stack_entry(with_obj, block_end)) )
        {
                // skip the full block
-               // FIXME, is this a log_aserror?
-               log_error(_("With-block skipped"
-                       " (with stack size exceeds limit of "
-                       SIZET_FMT " elements)"),
-                       thread.getWithStackLimit());
                thread.next_pc += block_length;
        }
 
@@ -3449,7 +3438,7 @@
        // contains name and args, while next tag is first tag
        // of the function body.
        swf_function* func = new swf_function(
-               &code, &env, thread.next_pc, thread.getWithStack());
+               &code, &env, thread.next_pc, thread.getScopeStack());
 
        size_t i = thread.pc + 3;
 

Index: server/vm/ActionExec.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- server/vm/ActionExec.cpp    26 Apr 2007 17:06:10 -0000      1.31
+++ server/vm/ActionExec.cpp    27 Apr 2007 16:09:01 -0000      1.32
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: ActionExec.cpp,v 1.31 2007/04/26 17:06:10 strk Exp $ */
+/* $Id: ActionExec.cpp,v 1.32 2007/04/27 16:09:01 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -73,7 +73,8 @@
 
 ActionExec::ActionExec(const swf_function& func, as_environment& newEnv, 
as_value* nRetVal, as_object* this_ptr)
        :
-       with_stack(func.getWithStack()),
+       with_stack(),
+       _scopeStack(func.getScopeStack()),
        // See comment in header
        _with_stack_limit(7),
        _function_var(func.isFunction2() ? 2 : 1),
@@ -92,11 +93,23 @@
        if ( env.get_version() > 5 ) {
            _with_stack_limit = 15;
        }
+
+       // SWF version 6 and higher pushes the activation object to the scope 
stack
+       if ( env.get_version() > 5 )
+       {
+               // We assume that the swf_function () operator already 
initialized its environment
+               // so that it's activation object is now in the top element of 
the CallFrame stack
+               //
+               as_environment::CallFrame& topFrame = newEnv.topCallFrame();
+               assert(topFrame.func == &func);
+               _scopeStack.push_back(topFrame.locals);
+       }
 }
 
 ActionExec::ActionExec(const action_buffer& abuf, as_environment& newEnv)
        :
        with_stack(),
+       _scopeStack(), // TODO: initialize the scope stack somehow
        _with_stack_limit(7),
        _function_var(0),
        _func(NULL),
@@ -152,7 +165,9 @@
            // Cleanup any expired "with" blocks.
            while ( ! with_stack.empty() && pc >= with_stack.back().end_pc() ) {
                // Drop last stack element
+               assert(with_stack.back().object() == _scopeStack.back().get());
                with_stack.pop_back();
+               _scopeStack.pop_back(); // hopefully nothing gets after the 
'with' stack.
            }
 
        // Get the opcode.
@@ -315,18 +330,21 @@
 ActionExec::pushWithEntry(const with_stack_entry& entry)
 {
        // See comment in header about _with_stack_limit
+       if (with_stack.size() >= _with_stack_limit)
+       {
        IF_VERBOSE_ASCODING_ERRORS (
-       if (with_stack.size() >= _with_stack_limit) {
            log_aserror(_("'With' stack depth (" SIZET_FMT ") "
                        "exceeds the allowed limit for current SWF "
                        "target version (" SIZET_FMT " for version %d)."
                        " Don't expect this movie to work with all players."),
                        with_stack.size()+1, _with_stack_limit,
                        env.get_version());
-       }
        );
+           return false;
+       }
        
        with_stack.push_back(entry);
+       _scopeStack.push_back(const_cast<as_object*>(entry.object()));
        return true;
 }
 
@@ -339,7 +357,7 @@
            boost::to_lower(namei, vm.getLocale());
        }
        
-       return env.del_variable_raw(namei, with_stack);
+       return env.del_variable_raw(namei, getScopeStack());
 }
 
 bool
@@ -366,7 +384,7 @@
            boost::to_lower(namei, vm.getLocale());
        }
        
-       return env.set_variable(namei, val, getWithStack());
+       return env.set_variable(namei, val, getScopeStack());
 }
 
 as_value
@@ -379,7 +397,7 @@
            boost::to_lower(namei, vm.getLocale());
        }
        
-       return env.get_variable(namei, getWithStack());
+       return env.get_variable(namei, getScopeStack());
 }
 
 as_value
@@ -392,7 +410,7 @@
            boost::to_lower(namei, vm.getLocale());
        }
        
-       return env.get_variable(namei, getWithStack(), target);
+       return env.get_variable(namei, getScopeStack(), target);
 }
 
 void

Index: server/vm/ActionExec.h
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- server/vm/ActionExec.h      26 Apr 2007 17:06:10 -0000      1.16
+++ server/vm/ActionExec.h      27 Apr 2007 16:09:01 -0000      1.17
@@ -43,6 +43,18 @@
 
 private: 
 
+       /// Returns 'with' stack associated with this execution thread
+       // 
+       /// If you need to modify it, use the pushWithEntry() function.
+       ///
+       /// TODO: deprecate this
+       ///
+       const std::vector<with_stack_entry>& getWithStack() const
+       {
+               return with_stack;
+       }
+
+
        /// Run after a complete run, or after an run interrupted by 
        /// a bail-out exception (ActionLimitException, for example)
        void cleanupAfterRun();
@@ -50,6 +62,11 @@
        /// the 'with' stack associated with this execution thread
        std::vector<with_stack_entry> with_stack;
 
+       typedef as_environment::ScopeStack ScopeStack;
+
+       /// the scope stack associated with this execution thread
+       ScopeStack _scopeStack;
+
        /// Limit of with stack
        //
        /// This is 7 for SWF up to 5 and 15 for SWF 6 and up
@@ -178,13 +195,13 @@
        /// Get the current 'this' pointer, for use in function calls
        as_object* getThisPointer() { return _function_var ? _this_ptr.get() : 
getTarget(); }
 
-       /// Returns 'with' stack associated with this execution thread
+       /// Returns the scope stack associated with this execution thread
        // 
-       /// If you need to modify it, use the pushWithEntry() function.
+       /// TODO: return by const ref instead
        ///
-       const std::vector<with_stack_entry>& getWithStack() const
+       const ScopeStack& getScopeStack() const
        {
-               return with_stack;
+               return _scopeStack;
        }
 
        /// Return the maximum allowed 'with' stack limit.

Index: testsuite/actionscript.all/Function.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Function.as,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- testsuite/actionscript.all/Function.as      26 Apr 2007 20:47:33 -0000      
1.46
+++ testsuite/actionscript.all/Function.as      27 Apr 2007 16:09:01 -0000      
1.47
@@ -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.46 2007/04/26 20:47:33 strk Exp $";
+rcsid="$Id: Function.as,v 1.47 2007/04/27 16:09:01 strk Exp $";
 
 #include "check.as"
 
@@ -309,7 +309,7 @@
   check_equals ( result1, "hello" );
 
   // Gnash fails here, we want this fixed!
-  xcheck_equals ( result2, "hello" );
+  check_equals ( result2, "hello" );
 
 #else // SWF5 or lower seems unable to work with nested functions
 

Index: testsuite/swfdec/PASSING
===================================================================
RCS file: /sources/gnash/gnash/testsuite/swfdec/PASSING,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- testsuite/swfdec/PASSING    27 Apr 2007 09:43:43 -0000      1.20
+++ testsuite/swfdec/PASSING    27 Apr 2007 16:09:01 -0000      1.21
@@ -44,6 +44,8 @@
 name2.swf
 registerclass-properties.swf
 function-scope-5.swf
+function-scope-6.swf
+function-scope-7.swf
 setinterval-clear.swf
 onload-childparent.swf
 registerclass-previous.swf




reply via email to

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