gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/avm2 r9588: Add function as_object::set_me


From: Tom Stellard
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9588: Add function as_object::set_member_slot() .
Date: Sun, 05 Oct 2008 19:59:44 +0800
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9588
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Sun 2008-10-05 19:59:44 +0800
message:
  Add function as_object::set_member_slot() .
modified:
  libcore/as_object.cpp
  libcore/as_object.h
=== modified file 'libcore/as_object.cpp'
--- a/libcore/as_object.cpp     2008-09-17 03:06:58 +0000
+++ b/libcore/as_object.cpp     2008-10-05 11:59:44 +0000
@@ -538,6 +538,18 @@
        _members.reserveSlot(name, nsId, slotId);
 }
 
+bool
+as_object::set_member_slot(int order, const as_value& val, bool ifFound)
+{
+       const Property* prop = _members.getPropertyByOrder(order);
+       if(prop){
+               return set_member_default(prop->getName(), val, 
prop->getNamespace(), ifFound);
+       }
+       else{
+               return false;
+       }
+}
+
 // Handles read_only and static properties properly.
 bool
 as_object::set_member_default(string_table::key key, const as_value& val,

=== modified file 'libcore/as_object.h'
--- a/libcore/as_object.h       2008-09-17 03:06:58 +0000
+++ b/libcore/as_object.h       2008-10-05 11:59:44 +0000
@@ -1091,6 +1091,27 @@
        bool get_member_default(string_table::key name, as_value* val, 
                string_table::key nsname);
 
+       ///Set a member value at a given slot.
+       //
+       ///This is a wrapper around set_member_default.
+       /// @param order
+       ///
+       /// The slot index of the property.
+       /// @param val
+       ///     Value to assign to the named property.
+       ///
+       /// @param ifFound
+       ///     If true, don't create a new member, but only update
+       ///     an existing one.
+       ///
+       /// @return true if the member exists at the given slot, 
+       /// false otherwise.
+       ///     NOTE: the return doesn't tell if the member exists after
+       ///           the call, as watch triggers might have deleted it
+       ///           after setting.
+       ///
+       bool set_member_slot(int order, const as_value& val, bool ifFound = 
false);
+
        /// Set a member value
        //
        /// This is the default implementation, taking care of


reply via email to

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