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


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. f873e92c96b90a00d291093552895c93cf764853
Date: Tue, 28 Sep 2010 13:13:30 +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  f873e92c96b90a00d291093552895c93cf764853 (commit)
       via  9e038f50af44a97b5923e8abe5b33cbdb0da3d11 (commit)
       via  76dce38eb0171a912ea220d4c5e4de694fd397f3 (commit)
       via  3d96aaab326465b46ee9d4ac3fe78d67c3b953ab (commit)
       via  f7582062891a3d46c86cd2ab3d65bb8cb3f0bf15 (commit)
       via  13577f071b45cad1d751dd1bde931101f7bf0bac (commit)
       via  6847d2d4505908ebbcac2253f8fb0f914c50bc88 (commit)
      from  6695ce99a151faa420fa0814eeeeb3fe01fbd6a1 (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=f873e92c96b90a00d291093552895c93cf764853


commit f873e92c96b90a00d291093552895c93cf764853
Author: Benjamin Wolsey <address@hidden>
Date:   Tue Sep 28 15:03:48 2010 +0200

    Const correct.

diff --git a/libcore/asobj/Array_as.cpp b/libcore/asobj/Array_as.cpp
index 7301404..a676d23 100644
--- a/libcore/asobj/Array_as.cpp
+++ b/libcore/asobj/Array_as.cpp
@@ -905,7 +905,7 @@ namespace {
 void
 attachArrayStatics(as_object& proto)
 {
-    int flags = 0; // these are not protected
+    const int flags = 0; // these are not protected
     proto.init_member("CASEINSENSITIVE", SORT_CASE_INSENSITIVE, flags);
     proto.init_member("DESCENDING", SORT_DESCENDING, flags);
     proto.init_member("UNIQUESORT", SORT_UNIQUE, flags);

http://git.savannah.gnu.org/cgit//commit/?id=9e038f50af44a97b5923e8abe5b33cbdb0da3d11


commit 9e038f50af44a97b5923e8abe5b33cbdb0da3d11
Author: Benjamin Wolsey <address@hidden>
Date:   Tue Sep 28 14:42:45 2010 +0200

    Fix more lookups.

diff --git a/libcore/asobj/Array_as.cpp b/libcore/asobj/Array_as.cpp
index aa3107f..7301404 100644
--- a/libcore/asobj/Array_as.cpp
+++ b/libcore/asobj/Array_as.cpp
@@ -62,52 +62,53 @@ enum SortFlags {
     SORT_NUMERIC = (1<<4) // 16
 };
 
-struct indexed_as_value;
-
-typedef boost::function2<bool, const as_value&, const as_value&> as_cmp_fn;
-
-void attachArrayInterface(as_object& proto);
-void attachArrayStatics(as_object& proto);
-
-as_value join(as_object* array, const std::string& separator);
-
-as_value array_new(const fn_call& fn);
-as_value array_slice(const fn_call& fn);
-as_value array_concat(const fn_call& fn);
-as_value array_toString(const fn_call& fn);
-as_value array_join(const fn_call& fn);
-as_value array_reverse(const fn_call& fn);
-as_value array_shift(const fn_call& fn);
-as_value array_pop(const fn_call& fn);
-as_value array_unshift(const fn_call& fn);
-as_value array_push(const fn_call& fn);
-as_value array_sortOn(const fn_call& fn);
-as_value array_sort(const fn_call& fn);
-as_value array_splice(const fn_call& fn);
-
-string_table::key getKey(const fn_call& fn, size_t i);
-int isIndex(const std::string& name);
-
-/// Implementation of foreachArray that takes a start and end range.
-template<typename T> void foreachArray(as_object& array, int start,
-                                      int end, T& pred);
-
-inline bool int_lt_or_eq (int a) {
-    return a <= 0;
-}
+    struct indexed_as_value;
 
-inline bool int_gt (int a) {
-    return a > 0;
-}
+    typedef boost::function2<bool, const as_value&, const as_value&> as_cmp_fn;
+
+    void attachArrayInterface(as_object& proto);
+    void attachArrayStatics(as_object& proto);
+
+    as_value join(as_object* array, const std::string& separator);
 
-void getIndexedElements(as_object& array, std::vector<indexed_as_value>& v);
+    as_value array_new(const fn_call& fn);
+    as_value array_slice(const fn_call& fn);
+    as_value array_concat(const fn_call& fn);
+    as_value array_toString(const fn_call& fn);
+    as_value array_join(const fn_call& fn);
+    as_value array_reverse(const fn_call& fn);
+    as_value array_shift(const fn_call& fn);
+    as_value array_pop(const fn_call& fn);
+    as_value array_unshift(const fn_call& fn);
+    as_value array_push(const fn_call& fn);
+    as_value array_sortOn(const fn_call& fn);
+    as_value array_sort(const fn_call& fn);
+    as_value array_splice(const fn_call& fn);
 
-void pushIndices(as_object& o, const std::vector<indexed_as_value>& index);
+    string_table::key getKey(const fn_call& fn, size_t i);
+    int isIndex(const std::string& name);
 
-/// Set the length property of an object only if it is a genuine array.
-void setArrayLength(as_object& o, const int size);
+    /// Implementation of foreachArray that takes a start and end range.
+    template<typename T> void foreachArray(as_object& array, int start,
+                           int end, T& pred);
+
+    inline bool int_lt_or_eq (int a) {
+        return a <= 0;
+    }
+
+    inline bool int_gt (int a) {
+        return a > 0;
+    }
+
+    void getIndexedElements(as_object& array, std::vector<indexed_as_value>& 
v);
+
+    void pushIndices(as_object& o, const std::vector<indexed_as_value>& index);
+
+    /// Set the length property of an object only if it is a genuine array.
+    void setArrayLength(as_object& o, const int size);
 
     void resizeArray(as_object& o, const int size);
+
 }
 
 /// Function objects for foreachArray()
@@ -624,16 +625,18 @@ public:
     {
     }
 
-    bool operator() (const as_value& a, const as_value& b)
-    {
-        as_value av, bv;
+    bool operator()(const as_value& a, const as_value& b) const {
 
         // why do we cast ao/bo to objects here ?
-        boost::intrusive_ptr<as_object> ao = a.to_object(getGlobal(_obj));
-        boost::intrusive_ptr<as_object> bo = b.to_object(getGlobal(_obj));
+        as_object* ao = a.to_object(getGlobal(_obj));
+        as_object* bo = b.to_object(getGlobal(_obj));
+
+        assert(ao);
+        assert(bo);
         
-        ao->get_member(_prop, &av);
-        bo->get_member(_prop, &bv);
+        const as_value& av = arrayProperty(*ao, _prop);
+        const as_value& bv = arrayProperty(*bo, _prop);
+
         return _comp(av, bv);
     }
 private:
@@ -680,10 +683,9 @@ public:
         
         for (Props::iterator pit = _prps.begin(), pend = _prps.end();
                 pit != pend; ++pit, ++cmp) {
-            as_value av, bv;
-
-            ao->get_member(*pit, &av);
-            bo->get_member(*pit, &bv);
+            
+            const as_value& av = arrayProperty(*ao, *pit);
+            const as_value& bv = arrayProperty(*bo, *pit);
 
             if ((*cmp)(av, bv)) return true;
             if ((*cmp)(bv, av)) return false;
@@ -707,9 +709,8 @@ public:
     {
     }
 
-    bool operator() (const as_value& a, const as_value& b)
-    {
-        if ( _cmps.empty() ) return false;
+    bool operator()(const as_value& a, const as_value& b) const {
+        if (_cmps.empty()) return false;
 
         Comps::const_iterator cmp = _cmps.begin();
 
@@ -720,11 +721,10 @@ public:
         for (Props::iterator pit = _prps.begin(), pend = _prps.end();
                 pit != pend; ++pit, ++cmp)
         {
-            as_value av, bv;
-            ao->get_member(*pit, &av);
-            bo->get_member(*pit, &bv);
+            const as_value& av = arrayProperty(*ao, *pit);
+            const as_value& bv = arrayProperty(*bo, *pit);
 
-            if ( !(*cmp)(av, bv) ) return false;
+            if (!(*cmp)(av, bv)) return false;
         }
         
         return true;
@@ -836,6 +836,7 @@ checkArrayLength(as_object& array, const ObjectURI& uri, 
const as_value& val)
 size_t
 arrayLength(as_object& array)
 {
+    // TODO: check whether this should use only ownProperty.
     as_value length;
     if (!array.get_member(NSV::PROP_LENGTH, &length)) return 0;
     
@@ -844,6 +845,13 @@ arrayLength(as_object& array)
     return size;
 }
 
+as_value
+arrayProperty(as_object& array, const ObjectURI& prop)
+{
+    Property* p = array.getOwnProperty(prop);
+    return p ? p->getValue(array) : as_value();
+}
+
 void
 registerArrayNative(as_object& global)
 {
@@ -978,7 +986,7 @@ array_splice(const fn_call& fn)
     // Push removed elements to the new array.
     for (size_t i = 0; i < remove; ++i) {
         const size_t key = getKey(fn, start + i);
-        callMethod(ret, NSV::PROP_PUSH, array->getMember(key));
+        callMethod(ret, NSV::PROP_PUSH, arrayProperty(*array, key));
     }
 
     // Shift elements in 'this' array by simple assignment, not delete
@@ -1234,14 +1242,11 @@ array_unshift(const fn_call& fn)
 
     const size_t size = arrayLength(*array);
 
-    string_table& st = getStringTable(fn);
-    as_value ret = array->getMember(st.find("0"));
-    
     for (size_t i = size + shift - 1; i >= shift ; --i) {
         const string_table::key nextkey = getKey(fn, i - shift);
         const string_table::key currentkey = getKey(fn, i);
         array->delProperty(currentkey);
-        array->set_member(currentkey, array->getMember(nextkey));
+        array->set_member(currentkey, arrayProperty(*array, nextkey));
     }
 
     for (size_t i = shift; i > 0; --i) {
@@ -1265,7 +1270,7 @@ array_pop(const fn_call& fn)
     if (size < 1) return as_value();
 
     const string_table::key ind = getKey(fn, size - 1);
-    as_value ret = array->getMember(ind);
+    as_value ret = arrayProperty(*array, ind);
     array->delProperty(ind);
     
     setArrayLength(*array, size - 1);
@@ -1283,13 +1288,13 @@ array_shift(const fn_call& fn)
     // An array with no elements has nothing to return.
     if (size < 1) return as_value();
 
-    as_value ret = array->getMember(getKey(fn, 0));
+    as_value ret = arrayProperty(*array, getKey(fn, 0));
 
     for (size_t i = 0; i < static_cast<size_t>(size - 1); ++i) {
         const string_table::key nextkey = getKey(fn, i + 1);
         const string_table::key currentkey = getKey(fn, i);
         array->delProperty(currentkey);
-        array->set_member(currentkey, array->getMember(nextkey));
+        array->set_member(currentkey, arrayProperty(*array, nextkey));
     }
     
     setArrayLength(*array, size - 1);
@@ -1310,8 +1315,8 @@ array_reverse(const fn_call& fn)
     for (size_t i = 0; i < static_cast<size_t>(size) / 2; ++i) {
         const string_table::key bottomkey = getKey(fn, i);
         const string_table::key topkey = getKey(fn, size - i - 1);
-        const as_value top = array->getMember(topkey);
-        const as_value bottom = array->getMember(bottomkey);
+        const as_value top = arrayProperty(*array, topkey);
+        const as_value bottom = arrayProperty(*array, bottomkey);
         array->delProperty(topkey);
         array->delProperty(bottomkey);
         array->set_member(bottomkey, top);
@@ -1460,8 +1465,7 @@ join(as_object* array, const std::string& separator)
     for (size_t i = 0; i < size; ++i) {
         if (i) s += separator;
         const std::string& index = boost::lexical_cast<std::string>(i);
-        Property* prop = array->getOwnProperty(st.find(index));
-        const as_value& el = prop ? prop->getValue(*array) : as_value();
+        const as_value& el = arrayProperty(*array, st.find(index));
         s += el.to_string(version);
     }
     return as_value(s);
@@ -1495,7 +1499,7 @@ void foreachArray(as_object& array, int start, int end, 
T& pred)
     string_table& st = getStringTable(array);
 
     for (size_t i = start; i < static_cast<size_t>(end); ++i) {
-        pred(array.getMember(arrayKey(st, i)));
+        pred(arrayProperty(array, arrayKey(st, i)));
     }
 }
 
diff --git a/libcore/asobj/Array_as.h b/libcore/asobj/Array_as.h
index 02fc5a0..1ad5203 100644
--- a/libcore/asobj/Array_as.h
+++ b/libcore/asobj/Array_as.h
@@ -28,6 +28,17 @@ namespace gnash {
 
 namespace gnash {
 
+/// Get an own property of an array, or undefined if it doesn't exist.
+//
+/// Array functions do not search the prototype chain or call __resolve to
+/// find a property. There is no need to use this function directly; it is
+/// here for foreachArray().
+//
+/// @param array    The object whose array length is needed.
+/// @param prop     The property to find.
+/// @return         The value of the property, or undefined if it is not found.
+as_value arrayProperty(as_object& array, const ObjectURI& prop);
+
 /// Get the length of an object as though it were an array
 //
 /// It may well be an array, but this also works on normal objects with a 
@@ -83,7 +94,7 @@ void foreachArray(as_object& array, T& pred)
     string_table& st = getStringTable(array);
 
     for (size_t i = 0; i < static_cast<size_t>(size); ++i) {
-        pred(array.getMember(arrayKey(st, i)));
+        pred(arrayProperty(array, arrayKey(st, i)));
     }
 }
 
diff --git a/testsuite/actionscript.all/array.as 
b/testsuite/actionscript.all/array.as
index fbd4548..120b274 100644
--- a/testsuite/actionscript.all/array.as
+++ b/testsuite/actionscript.all/array.as
@@ -1646,6 +1646,12 @@ check_equals(t.join("/"), "zero/////five");
 #endif
 check_equals(rs, 1);
 
+// Same with other functions.
+t.sort();
+check_equals(rs, 1);
+t.reverse();
+check_equals(rs, 1);
+
 #if OUTPUT_VERSION > 5
 
 Empty = function() {};
@@ -1751,11 +1757,11 @@ check_equals(ar.__proto__, "string");
 
 
 #if OUTPUT_VERSION < 6
- check_totals(543);
+ check_totals(545);
 #else
 # if OUTPUT_VERSION < 7
-  check_totals(627);
+  check_totals(629);
 # else
-  check_totals(637);
+  check_totals(639);
 # endif
 #endif

http://git.savannah.gnu.org/cgit//commit/?id=76dce38eb0171a912ea220d4c5e4de694fd397f3


commit 76dce38eb0171a912ea220d4c5e4de694fd397f3
Author: Benjamin Wolsey <address@hidden>
Date:   Tue Sep 28 14:00:42 2010 +0200

    Make Properties smaller.

diff --git a/libcore/Property.h b/libcore/Property.h
index 86c38b2..3fad823 100644
--- a/libcore/Property.h
+++ b/libcore/Property.h
@@ -150,13 +150,6 @@ private:
 
        private:
 
-               as_function* _getter;
-               as_function* _setter;
-
-               as_value _underlyingValue;
-
-               mutable bool _beingAccessed;
-
                /// For SWF6 (not higher) a user-defined getter-setter would not
         /// be invoked while being set. This ScopedLock helps marking a
         /// Getter-Setter as being invoked in an exception-safe manner.
@@ -193,11 +186,16 @@ private:
                        bool _obtainedLock;
 
         };
+
+               as_function* _getter;
+               as_function* _setter;
+               as_value _underlyingValue;
+               mutable bool _beingAccessed;
     };
 
        /// Native GetterSetter
-       class NativeGetterSetter {
-
+       class NativeGetterSetter
+    {
        public:
 
                NativeGetterSetter(as_c_function_ptr get, as_c_function_ptr set)
@@ -205,19 +203,16 @@ private:
                        _getter(get), _setter(set) {}
 
                /// Invoke the getter
-               as_value get(fn_call& fn) const
-               {
+               as_value get(fn_call& fn) const {
                        return _getter(fn);
                }
 
                /// Invoke the setter
-               void set(fn_call& fn)
-               {
+               void set(fn_call& fn) {
                        _setter(fn);
                }
 
        private:
-
                as_c_function_ptr _getter;
                as_c_function_ptr _setter;
        };
@@ -240,55 +235,55 @@ public:
        Property(const ObjectURI& uri)
         : 
                _bound(as_value()),
-        _destructive(false),
-        _uri(uri)
+        _uri(uri),
+        _destructive(false)
        {}
 
        Property(const ObjectURI& uri, const as_value& value,
             const PropFlags& flags = PropFlags())
         :
-               _flags(flags),
         _bound(value),
-        _destructive(false),
-               _uri(uri)
+               _uri(uri),
+               _flags(flags),
+        _destructive(false)
        {}
 
        Property(const ObjectURI& uri,
                as_function *getter, as_function *setter, 
                const PropFlags& flags, bool destroy = false)
         :
-               _flags(flags), 
         _bound(GetterSetter(getter, setter)),
-               _destructive(destroy),
-        _uri(uri)
+        _uri(uri),
+               _flags(flags), 
+               _destructive(destroy)
        {}
 
        Property(const ObjectURI& uri, as_function *getter, as_function *setter,
             bool destroy = false)
         :
-               _flags(),
         _bound(GetterSetter(getter, setter)),
-        _destructive(destroy),
-        _uri(uri)
+        _uri(uri),
+               _flags(),
+        _destructive(destroy)
        {}
 
        Property(const ObjectURI& uri, as_c_function_ptr getter,
             as_c_function_ptr setter, const PropFlags& flags,
             bool destroy = false)
                :
-               _flags(flags),
         _bound(GetterSetter(getter, setter)),
-        _destructive(destroy),
-        _uri(uri)
+        _uri(uri),
+               _flags(flags),
+        _destructive(destroy)
        {}
        
     /// Copy constructor
        Property(const Property& p)
         :
-               _flags(p._flags),
         _bound(p._bound),
-        _destructive(p._destructive),
-        _uri(p._uri)
+        _uri(p._uri),
+               _flags(p._flags),
+        _destructive(p._destructive)
        {}
 
        /// accessor to the properties flags
@@ -378,22 +373,22 @@ private:
         TYPE_GETTER_SETTER
     };
 
-       /// Properties flags
-       mutable PropFlags _flags;
-
        // Store the various types of things that can be held.
        typedef boost::variant<boost::blank, as_value, GetterSetter> BoundType;
 
     /// The value of the property.
        mutable BoundType _bound;
+       
+    // TODO: this should be const, but the assignment operator is still needed 
+    ObjectURI _uri;
+
+       /// Properties flags
+       mutable PropFlags _flags;
 
        // If true, as soon as getValue has been invoked once, the
        // returned value becomes a fixed return (though it can be
        // overwritten if not readOnly)
        mutable bool _destructive;
-       
-    // TODO: this should be const, but the assignment operator is still needed 
-    ObjectURI _uri;
 
 };
        

http://git.savannah.gnu.org/cgit//commit/?id=3d96aaab326465b46ee9d4ac3fe78d67c3b953ab


commit 3d96aaab326465b46ee9d4ac3fe78d67c3b953ab
Author: Benjamin Wolsey <address@hidden>
Date:   Tue Sep 28 14:00:23 2010 +0200

    Add PropFlags to ClassSizes.

diff --git a/testsuite/libcore.all/ClassSizes.cpp 
b/testsuite/libcore.all/ClassSizes.cpp
index 6f8810b..2a7286b 100644
--- a/testsuite/libcore.all/ClassSizes.cpp
+++ b/testsuite/libcore.all/ClassSizes.cpp
@@ -82,7 +82,7 @@ using namespace gnash::SWF;
 (as_object) \
 (DisplayObject) (StaticText) (MorphShape) (Shape) \
 (InteractiveObject) (MovieClip) (TextField) (Button) (Movie) \
-(movie_root) 
+(movie_root) (PropFlags)
 
 int
 main(int /*argc*/, char** /*argv*/)

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


commit f7582062891a3d46c86cd2ab3d65bb8cb3f0bf15
Author: Benjamin Wolsey <address@hidden>
Date:   Tue Sep 28 13:59:55 2010 +0200

    Use unsigned int of appropriate size.

diff --git a/libcore/PropFlags.h b/libcore/PropFlags.h
index a68cac1..774c236 100644
--- a/libcore/PropFlags.h
+++ b/libcore/PropFlags.h
@@ -20,19 +20,13 @@
 #define GNASH_AS_PROP_FLAGS_H
 
 #include <ostream>
+#include <boost/cstdint.hpp>
 
 namespace gnash {
 
 /// Flags defining the level of protection of a member
 class PropFlags
 {
-
-       /// Numeric flags
-       int _flags;
-
-       /// if true, this value is protected (internal to gnash)
-       //bool _protected;
-
 public:
 
        /// Actual flags
@@ -65,7 +59,9 @@ public:
        };
 
        /// Default constructor
-       PropFlags() : _flags(0)
+       PropFlags()
+        :
+        _flags(0)
        {
        }
 
@@ -80,24 +76,22 @@ public:
        }
 
        /// Constructor, from numerical value
-       PropFlags(const int flags)
-               : _flags(flags)
+       PropFlags(boost::uint16_t flags)
+               :
+        _flags(flags)
        {
        }
 
-       bool operator== (const PropFlags& o) const
-       {
-               return ( _flags == o._flags );
+       bool operator==(const PropFlags& o) const {
+               return (_flags == o._flags);
        }
 
-       bool operator!= (const PropFlags& o) const
-       {
-               return ( _flags != o._flags );
+       bool operator!=(const PropFlags& o) const {
+        return !(*this == o);
        }
 
        /// Get "read-only" flag 
-       bool get_read_only() const
-       {
+       bool get_read_only() const {
            return (_flags & readOnly);
        }
 
@@ -120,8 +114,7 @@ public:
        void clear_dont_delete() { _flags &= ~dontDelete; }
 
        /// Get "don't enum" flag
-       bool get_dont_enum() const
-       {
+       bool get_dont_enum() const {
            return (_flags & dontEnum);
        }
 
@@ -157,8 +150,8 @@ public:
                
        }
 
-       /// accesor to the numerical flags value
-       int get_flags() const { return _flags; }
+       /// accessor to the numerical flags value
+    boost::uint16_t get_flags() const { return _flags; }
 
        /// set the numerical flags value (return the new value )
        /// If unlocked is false, you cannot un-protect from over-write,
@@ -173,12 +166,18 @@ public:
        ///
        /// @return true on success, false on failure (is protected)
        ///
-       bool set_flags(const int setTrue, const int setFalse = 0)
+       bool set_flags(boost::uint16_t setTrue, boost::uint16_t setFalse = 0)
        {
                _flags &= ~setFalse;
                _flags |= setTrue;
                return true;
        }
+
+private:
+
+       /// Numeric flags
+    boost::uint16_t _flags;
+
 };
 
 inline std::ostream&

http://git.savannah.gnu.org/cgit//commit/?id=13577f071b45cad1d751dd1bde931101f7bf0bac


commit 13577f071b45cad1d751dd1bde931101f7bf0bac
Author: Benjamin Wolsey <address@hidden>
Date:   Tue Sep 28 13:59:26 2010 +0200

    Fix property lookup for join().

diff --git a/libcore/asobj/Array_as.cpp b/libcore/asobj/Array_as.cpp
index ff8dce5..aa3107f 100644
--- a/libcore/asobj/Array_as.cpp
+++ b/libcore/asobj/Array_as.cpp
@@ -1458,11 +1458,10 @@ join(as_object* array, const std::string& separator)
     const int version = getSWFVersion(*array);
 
     for (size_t i = 0; i < size; ++i) {
-        std::ostringstream os;
-        os << i;
         if (i) s += separator;
-        as_value el;
-        array->get_member(st.find(os.str()), &el);
+        const std::string& index = boost::lexical_cast<std::string>(i);
+        Property* prop = array->getOwnProperty(st.find(index));
+        const as_value& el = prop ? prop->getValue(*array) : as_value();
         s += el.to_string(version);
     }
     return as_value(s);
diff --git a/testsuite/actionscript.all/array.as 
b/testsuite/actionscript.all/array.as
index 4694834..fbd4548 100644
--- a/testsuite/actionscript.all/array.as
+++ b/testsuite/actionscript.all/array.as
@@ -1640,11 +1640,11 @@ check_equals(t[2], "om");
 
 // But join() only uses own properties: no resolve, no chain.
 #if OUTPUT_VERSION > 6
-xcheck_equals(t.join("/"), 
"zero/undefined/undefined/undefined/undefined/five");
+check_equals(t.join("/"), "zero/undefined/undefined/undefined/undefined/five");
 #else
-xcheck_equals(t.join("/"), "zero/////five");
+check_equals(t.join("/"), "zero/////five");
 #endif
-xcheck_equals(rs, 1);
+check_equals(rs, 1);
 
 #if OUTPUT_VERSION > 5
 

http://git.savannah.gnu.org/cgit//commit/?id=6847d2d4505908ebbcac2253f8fb0f914c50bc88


commit 6847d2d4505908ebbcac2253f8fb0f914c50bc88
Author: Benjamin Wolsey <address@hidden>
Date:   Tue Sep 28 13:52:44 2010 +0200

    Test __resolve with array functions.

diff --git a/testsuite/actionscript.all/array.as 
b/testsuite/actionscript.all/array.as
index 9ae51be..4694834 100644
--- a/testsuite/actionscript.all/array.as
+++ b/testsuite/actionscript.all/array.as
@@ -1618,6 +1618,34 @@ o.sort();
  xcheck_equals(traceProps(o), "5,4,3,2,1,sort,length,7,6,");
 #endif
 
+// Test __resolve with arrays
+
+rs = 0;
+t = [];
+o = new Object();
+o[2] = "om";
+o.__proto__ = t.__proto__;
+t.__proto__ = o;
+t.__resolve = function(a) { ++rs; return "resolved " + a; };
+
+t[0] = "zero";
+t[5] = "five";
+
+// Resolve works with normal property lookup.
+check_equals(t[3], "resolved 3");
+check_equals(rs, 1);
+
+// Prototype chain checked in property lookup.
+check_equals(t[2], "om");
+
+// But join() only uses own properties: no resolve, no chain.
+#if OUTPUT_VERSION > 6
+xcheck_equals(t.join("/"), 
"zero/undefined/undefined/undefined/undefined/five");
+#else
+xcheck_equals(t.join("/"), "zero/////five");
+#endif
+xcheck_equals(rs, 1);
+
 #if OUTPUT_VERSION > 5
 
 Empty = function() {};
@@ -1723,11 +1751,11 @@ check_equals(ar.__proto__, "string");
 
 
 #if OUTPUT_VERSION < 6
- check_totals(538);
+ check_totals(543);
 #else
 # if OUTPUT_VERSION < 7
-  check_totals(622);
+  check_totals(627);
 # else
-  check_totals(632);
+  check_totals(637);
 # endif
 #endif

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

Summary of changes:
 libcore/PropFlags.h                  |   45 +++++-----
 libcore/Property.h                   |   69 +++++++--------
 libcore/asobj/Array_as.cpp           |  151 +++++++++++++++++-----------------
 libcore/asobj/Array_as.h             |   13 +++-
 testsuite/actionscript.all/array.as  |   40 ++++++++-
 testsuite/libcore.all/ClassSizes.cpp |    2 +-
 6 files changed, 181 insertions(+), 139 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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