gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. 9486d541afc942807867


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 9486d541afc942807867ec719626a167ef1bd0b8
Date: Wed, 17 Nov 2010 16:40:41 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  9486d541afc942807867ec719626a167ef1bd0b8 (commit)
       via  58b0d226c7cf87382176f2c3e7bbc4d869ca2ab9 (commit)
      from  ff92b67ee9d7ece1621341c23d6e1cc515b11f20 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=9486d541afc942807867ec719626a167ef1bd0b8


commit 9486d541afc942807867ec719626a167ef1bd0b8
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Nov 17 17:04:11 2010 +0100

    Update comments, drop unneeded function.

diff --git a/libcore/vm/ActionExec.cpp b/libcore/vm/ActionExec.cpp
index a9e2239..74d15b5 100644
--- a/libcore/vm/ActionExec.cpp
+++ b/libcore/vm/ActionExec.cpp
@@ -616,12 +616,6 @@ ActionExec::setVariable(const std::string& name, const 
as_value& val)
 }
 
 as_value
-ActionExec::getVariable(const std::string& name)
-{
-    return gnash::getVariable(env, name, getScopeStack());
-}
-
-as_value
 ActionExec::getVariable(const std::string& name, as_object** target)
 {
     return gnash::getVariable(env, name, getScopeStack(), target);
diff --git a/libcore/vm/ActionExec.h b/libcore/vm/ActionExec.h
index 4365663..5b812ee 100644
--- a/libcore/vm/ActionExec.h
+++ b/libcore/vm/ActionExec.h
@@ -122,17 +122,11 @@ public:
 
        /// Create an execution thread 
        //
-       /// @param abuf
-       ///     the action code
-       ///
-       /// @param newEnv
-       ///     the execution environment (variables scope, stack etc.)
-       ///
-       /// @param abortOnUnloaded
-       ///     If true (the default) execution aborts as soon as the target
-    /// sprite is unloaded.
+       /// @param abuf             the action code
+       /// @param newEnv               the timeline context.
+       /// @param abortOnUnloaded  If true (default) execution aborts as soon
+    ///                         as the target sprite is unloaded.
        ///     NOTE: original target is fetched from the environment.
-       ///
        ActionExec(const action_buffer& abuf, as_environment& newEnv,
             bool abortOnUnloaded = true);
 
@@ -141,23 +135,19 @@ public:
        /// @param func     The function 
        /// @param newEnv   The execution environment (variables scope, stack 
etc.)
        /// @param nRetval  Where to return a value. If NULL any return will
-    /// be discarded.
+    ///                 be discarded.
        ActionExec(const Function& func, as_environment& newEnv,
             as_value* nRetVal, as_object* this_ptr);
 
-       /// \brief
-       /// Use this to push a try block.
-       /// t will be copied
+       /// Use this to push a try block. It will be copied
        void pushTryBlock(TryBlock t);
 
-       /// \brief
        /// Set the return value.
        void pushReturn(const as_value& t);
 
        /// The actual action buffer
        //
        /// TODO: provide a getter and make private
-       ///
        const action_buffer& code;
 
        /// TODO: provide a getter and make private ?
@@ -173,8 +163,7 @@ public:
        as_object* getThisPointer();
 
        /// Returns the scope stack associated with this execution thread
-       const ScopeStack& getScopeStack() const
-       {
+       const ScopeStack& getScopeStack() const {
                return _scopeStack;
        }
 
@@ -187,56 +176,34 @@ public:
        /// Skip the specified number of action tags 
        //
        /// The offset is relative to next_pc
-       ///
        void skip_actions(size_t offset);
 
        /// Delete named variable, seeking for it in the with stack if any
        //
-       /// @param name
-       ///     Name of the variable. Supports slash and dot syntax.
-       ///     Name is converted to lowercase if SWF version is < 7.
-       ///
+       /// @param name     Name of the variable. Supports slash and dot syntax.
        bool delVariable(const std::string& name);
 
        /// Set a named variable, seeking for it in the with stack if any.
        //
-       /// @param name
-       ///     Name of the variable. Supports slash and dot syntax.
-       ///     Name is converted to lowercase if SWF version is < 7.
-       ///
+       /// @param name     Name of the variable. Supports slash and dot syntax.
        void setVariable(const std::string& name, const as_value& val);
 
-       /// \brief
-       /// If in a function context set a local variable,
-       /// otherwise, set a normal variable.
+       /// Set a function-local variable
+    //
+    /// If we're not in a function, set a normal variable.
        //
-       /// @param name
-       ///     Name of the variable. Supports slash and dot syntax.
-       ///     Name is converted to lowercase if SWF version is < 7.
-       ///
+       /// @param name Name of the variable. Supports slash and dot syntax.
+    /// @param val  The value to set the variable to.
        void setLocalVariable(const std::string& name, const as_value& val);
 
        /// Get a named variable, seeking for it in the with stack if any.
        //
-       /// @param name
-       ///     Name of the variable. Supports slash and dot syntax.
-       ///     Name is converted to lowercase if SWF version is < 7.
-       ///
-       as_value getVariable(const std::string& name);
-
-       /// Get a named variable, seeking for it in the with stack if any.
-       //
-       /// @param name
-       ///     Name of the variable. Supports slash and dot syntax.
-       ///     Name is converted to lowercase if SWF version is < 7.
-       ///
-       /// @param target
-       ///     An output parameter, will be set to point to the object
-       ///     containing any found variable.
-       ///     The pointer may be set to NULL if the variable was not 
-       ///     found or it belongs to no object (absolute references, for 
instance).
-       ///
-       as_value getVariable(const std::string& name, as_object** target);
+       /// @param name     Name of the variable. Supports slash and dot syntax.
+       /// @param target   An output parameter, will be set to point to the 
object
+       ///                     containing any found variable. If you aren't 
interested,
+    ///                 pass null (default). If the variable does not belong
+    ///                 to an object, target will be set to null.
+       as_value getVariable(const std::string& name, as_object** target = 0);
 
        /// Get current target.
        //
@@ -297,7 +264,6 @@ private:
     /// interrupted.
     //
     /// @return whether to continue executing the buffer
-    //
     /// @param t the try block to process.
     bool processExceptions(TryBlock& t);
 

http://git.savannah.gnu.org/cgit//commit/?id=58b0d226c7cf87382176f2c3e7bbc4d869ca2ab9


commit 58b0d226c7cf87382176f2c3e7bbc4d869ca2ab9
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Nov 17 16:53:29 2010 +0100

    We don't need a special function to delete an object property.

diff --git a/libcore/vm/ASHandlers.cpp b/libcore/vm/ASHandlers.cpp
index 8a7373e..5d2696f 100644
--- a/libcore/vm/ASHandlers.cpp
+++ b/libcore/vm/ASHandlers.cpp
@@ -2142,7 +2142,10 @@ ActionDelete(ActionExec& thread)
         return;
     }
 
-    env.top(1).set_bool(thread.delObjectMember(*obj, propertyname));
+    string_table& st = getStringTable(env);
+    const std::pair<bool, bool> ret = obj->delProperty(st.find(propertyname));
+
+    env.top(1).set_bool(ret.second);
 
     env.drop(1);
 
@@ -2181,7 +2184,11 @@ ActionDelete2(ActionExec& thread)
     }
 
     as_object* obj = safeToObject(getVM(thread.env), target);
-    env.top(1).set_bool(thread.delObjectMember(*obj, var));
+
+    string_table& st = getStringTable(env);
+    const std::pair<bool, bool> ret = obj->delProperty(st.find(var));
+
+    env.top(1).set_bool(ret.second);
 }
 
 void
diff --git a/libcore/vm/ActionExec.cpp b/libcore/vm/ActionExec.cpp
index 97948a7..a9e2239 100644
--- a/libcore/vm/ActionExec.cpp
+++ b/libcore/vm/ActionExec.cpp
@@ -609,14 +609,6 @@ ActionExec::delVariable(const std::string& name)
     return gnash::delVariable(env, name, getScopeStack());
 }
 
-bool
-ActionExec::delObjectMember(as_object& obj, const std::string& name)
-{
-    string_table& st = getStringTable(env);
-    std::pair<bool,bool> ret = obj.delProperty(st.find(name));
-    return ret.second;
-}
-
 void
 ActionExec::setVariable(const std::string& name, const as_value& val)
 {
diff --git a/libcore/vm/ActionExec.h b/libcore/vm/ActionExec.h
index a704ffb..4365663 100644
--- a/libcore/vm/ActionExec.h
+++ b/libcore/vm/ActionExec.h
@@ -198,19 +198,6 @@ public:
        ///
        bool delVariable(const std::string& name);
 
-       /// Delete a named object member.
-       //
-       /// @param obj
-       ///     The object to remove the member/property from.
-       ///
-       /// @param name
-       ///     Name of the member. 
-       ///     Name is converted to lowercase if SWF version is < 7.
-       ///
-       /// @return true if the member was successfully removed, false 
otherwise.
-       ///
-       bool delObjectMember(as_object& obj, const std::string& name);
-
        /// Set a named variable, seeking for it in the with stack if any.
        //
        /// @param name

-----------------------------------------------------------------------

Summary of changes:
 libcore/vm/ASHandlers.cpp |   11 +++++-
 libcore/vm/ActionExec.cpp |   14 -------
 libcore/vm/ActionExec.h   |   87 ++++++++++----------------------------------
 3 files changed, 29 insertions(+), 83 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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