gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash server/asobj/xmlnode.cpp ChangeLog


From: Sandro Santilli
Subject: [Gnash-commit] gnash server/asobj/xmlnode.cpp ChangeLog
Date: Thu, 15 Feb 2007 08:12:32 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/02/15 08:12:32

Modified files:
        server/asobj   : xmlnode.cpp 
        .              : ChangeLog 

Log message:
                * server/asobj/xmlnode.cpp: fix getter-setters for read-only
                  properties to survive attempts to set (logging the aserror).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/xmlnode.cpp?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2363&r2=1.2364

Patches:
Index: server/asobj/xmlnode.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/xmlnode.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- server/asobj/xmlnode.cpp    15 Feb 2007 04:05:41 -0000      1.11
+++ server/asobj/xmlnode.cpp    15 Feb 2007 08:12:32 -0000      1.12
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: xmlnode.cpp,v 1.11 2007/02/15 04:05:41 rsavoye Exp $ */
+/* $Id: xmlnode.cpp,v 1.12 2007/02/15 08:12:32 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -636,7 +636,13 @@
     assert(dynamic_cast<XMLNode*>(fn.this_ptr));
     XMLNode *ptr = static_cast<XMLNode*>(fn.this_ptr);
 
+    if ( fn.nargs == 0 ) {
     fn.result->set_int(ptr->nodeType());
+    } else {
+       IF_VERBOSE_ASCODING_ERRORS(
+           log_aserror("Tried to set read-only property XMLNode.nodeType");
+           );
+    }
 }
 
 // Both a getter and a (do-nothing) setter for firstChild
@@ -646,12 +652,23 @@
 //    GNASH_REPORT_FUNCTION;
     assert(dynamic_cast<XMLNode*>(fn.this_ptr));
     XMLNode *ptr = static_cast<XMLNode*>(fn.this_ptr);
+
+    if ( fn.nargs == 0 )
+    {
     XMLNode *node = ptr->firstChild();
     if (node == NULL) {
        fn.result->set_null();
     } else {
        fn.result->set_as_object(node);
     }
+    }
+    else
+    {
+       IF_VERBOSE_ASCODING_ERRORS(
+           log_aserror("Tried to set read-only property XMLNode.firstChild");
+           );
+    }
+
 }
 
 // Both a getter and a (do-nothing) setter for lastChild
@@ -661,6 +678,15 @@
 //    GNASH_REPORT_FUNCTION;
     assert(dynamic_cast<XMLNode*>(fn.this_ptr));
     XMLNode *ptr = static_cast<XMLNode*>(fn.this_ptr);
+
+    if ( fn.nargs != 0 )
+    {
+       IF_VERBOSE_ASCODING_ERRORS(
+           log_aserror("Tried to set read-only property XMLNode.lastChild");
+           );
+       return;
+    } 
+
     XMLNode *node = ptr->lastChild();
     if (node == NULL) {
        fn.result->set_null();
@@ -675,6 +701,14 @@
 {
     GNASH_REPORT_FUNCTION;
     
+    if ( fn.nargs != 0 )
+    {
+        IF_VERBOSE_ASCODING_ERRORS(
+        log_aserror("Tried to set read-only property XMLNode.nextSibling");
+        );
+       return;
+    }
+    
     assert(dynamic_cast<XMLNode*>(fn.this_ptr));
     XMLNode *ptr = static_cast<XMLNode*>(fn.this_ptr);
     XMLNode *node = ptr->nextSibling();
@@ -690,6 +724,15 @@
 xmlnode_previoussibling(const fn_call& fn)
 {
     GNASH_REPORT_FUNCTION;
+
+    if ( fn.nargs != 0 )
+    {
+        IF_VERBOSE_ASCODING_ERRORS(
+        log_aserror("Tried to set read-only property XMLNode.previousSibling");
+        );
+       return;
+    }
+
     assert(dynamic_cast<XMLNode*>(fn.this_ptr));
     XMLNode *ptr = static_cast<XMLNode*>(fn.this_ptr);
     XMLNode *node = ptr->previousSibling();

Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2363
retrieving revision 1.2364
diff -u -b -r1.2363 -r1.2364
--- ChangeLog   15 Feb 2007 04:05:42 -0000      1.2363
+++ ChangeLog   15 Feb 2007 08:12:32 -0000      1.2364
@@ -1,3 +1,8 @@
+2007-02-14 Sandro Santilli <address@hidden>
+
+       * server/asobj/xmlnode.cpp: fix getter-setters for read-only
+         properties to survive attempts to set (logging the aserror).
+
 2007-02-14  Rob Savoye  <address@hidden>
 
        * testsuite/actionscript.all/XMLNode.as: Fix tests for newly work




reply via email to

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