gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/sprite_instance.cpp test...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/sprite_instance.cpp test...
Date: Sun, 27 Apr 2008 22:16:32 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/04/27 22:16:31

Modified files:
        .              : ChangeLog 
        server         : sprite_instance.cpp 
        testsuite/misc-ming.all: VarAndCharClashTest.as 

Log message:
                * server/sprite_instance.cpp (get_member): our own properties
                  have precedence over our child names. Beside correctness
                  (this fixes a bug in potlatch) I suspect this will
                  speed up actionscript interpretation on the average.
                  (did make check did run faster or is it just my impression?).
                * testsuite/misc-ming.all/VarAndCharClashTest.as: success in
                  just-added new test.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6423&r2=1.6424
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.518&r2=1.519
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/VarAndCharClashTest.as?cvsroot=gnash&r1=1.6&r2=1.7

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6423
retrieving revision 1.6424
diff -u -b -r1.6423 -r1.6424
--- ChangeLog   27 Apr 2008 21:50:08 -0000      1.6423
+++ ChangeLog   27 Apr 2008 22:16:29 -0000      1.6424
@@ -1,3 +1,13 @@
+2008-04-28 Sandro Santilli <address@hidden>
+
+       * server/sprite_instance.cpp (get_member): our own properties
+         have precedence over our child names. Beside correctness
+         (this fixes a bug in potlatch) I suspect this will
+         speed up actionscript interpretation on the average.
+         (did make check did run faster or is it just my impression?).
+       * testsuite/misc-ming.all/VarAndCharClashTest.as: success in 
+         just-added new test.
+
 2008-04-27 Sandro Santilli <address@hidden>
 
        * testsuite/misc-ming.all/VarAndCharClashTest.as: test that

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.518
retrieving revision 1.519
diff -u -b -r1.518 -r1.519
--- server/sprite_instance.cpp  27 Apr 2008 18:13:15 -0000      1.518
+++ server/sprite_instance.cpp  27 Apr 2008 22:16:31 -0000      1.519
@@ -2317,44 +2317,23 @@
     }
   }
 
-  // Try object members, BEFORE display list items!
+  // Own members take precendence over display list items 
   // (see testcase VarAndCharClash.swf in testsuite/misc-ming.all)
-  //
-  // TODO: simplify the next line when get_member_default takes
-  //       a std::string
-  if (get_member_default(name_key, val, nsname))
-  {
-
-// ... trying to be useful to Flash coders ...
-// The check should actually be performed before any return
-// prior to the one due to a match in the DisplayList.
-// It's off by default anyway, so not a big deal.
-// See bug #18457
-//#define CHECK_FOR_NAME_CLASHES 1
-#ifdef CHECK_FOR_NAME_CLASHES
-    IF_VERBOSE_ASCODING_ERRORS(
-    if (  m_display_list.get_character_by_name_i(name) )
-    {
-      log_aserror(_("A sprite member (%s) clashes with "
-          "the name of an existing character "
-          "in its display list.  "
-          "The member will hide the "
-          "character"), name);
-    }
-    );
-#endif
-
+  as_object* owner = NULL;
+  Property* prop = findProperty(name_key, nsname, &owner);
+  if ( prop && owner == this ) 
+  {
+    try { *val = prop->getValue(*this); }
+    catch (ActionLimitException&) { throw; }
+    catch (ActionException& ex) { log_error(_("Caught exception: %s"), 
ex.what()); return false; }
     return true;
   }
 
-
   // Try items on our display list.
   character* ch;
   if ( _vm.getSWFVersion() >= 7 ) ch =  
m_display_list.get_character_by_name(name);
   else ch = m_display_list.get_character_by_name_i(name);
-
-  if (ch)
-  {
+  if (ch) {
       // Found object.
 
       // If the object is an ActionScript referenciable one we
@@ -2386,6 +2365,18 @@
     }
   }
 
+  // Inherited members come last 
+  // (see testcase VarAndCharClash.swf in testsuite/misc-ming.all)
+  if ( prop )
+  {
+    assert(owner != this);
+    try { *val = prop->getValue(*this); }
+    catch (ActionLimitException&) { throw; }
+    catch (ActionException& ex) { log_error(_("Caught exception: %s"), 
ex.what()); return false; }
+    return true;
+  }
+
+
   return false;
 
 }

Index: testsuite/misc-ming.all/VarAndCharClashTest.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/VarAndCharClashTest.as,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- testsuite/misc-ming.all/VarAndCharClashTest.as      27 Apr 2008 21:50:09 
-0000      1.6
+++ testsuite/misc-ming.all/VarAndCharClashTest.as      27 Apr 2008 22:16:31 
-0000      1.7
@@ -40,7 +40,7 @@
 
 MovieClip.prototype.stealth = 12;
 // Only own properties hide chars, not inherited ones
-xcheck_equals(typeof(stealth), 'movieclip'); 
+check_equals(typeof(stealth), 'movieclip'); 
 greenref._name = "stealth2";
 check_equals(typeof(stealth), 'number'); 
 




reply via email to

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