gnash-commit
[Top][All Lists]
Advanced

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

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


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/asobj/string.cpp testsui...
Date: Fri, 25 Jan 2008 20:42:41 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/01/25 20:42:40

Modified files:
        .              : ChangeLog 
        server/asobj   : string.cpp 
        testsuite/actionscript.all: String.as 

Log message:
        fix String.split('') to return an array in which *each* element is a 
character
        from the input. 

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5497&r2=1.5498
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/string.cpp?cvsroot=gnash&r1=1.50&r2=1.51
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/String.as?cvsroot=gnash&r1=1.34&r2=1.35

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5497
retrieving revision 1.5498
diff -u -b -r1.5497 -r1.5498
--- ChangeLog   25 Jan 2008 19:14:26 -0000      1.5497
+++ ChangeLog   25 Jan 2008 20:42:39 -0000      1.5498
@@ -1,5 +1,14 @@
 2008-01-25 Sandro Santilli <address@hidden>
 
+       * testsuite/actionscript.all/String.as: add better test
+         for split(''), as the available ones weren't catching
+         the bug just fixed.
+       * server/asobj/string.cpp: fix String.split('') to return
+         an array in which *each* element is a character from the
+         input. This fixes http://www.gazbming.com/sokoban2.swf.
+
+2008-01-25 Sandro Santilli <address@hidden>
+
        * gui/Makefile.am: generate klash.moc onlhy if KDE gui is enabled.
          Fixes bug #21019.
        * libamf/lcshm.{cpp,h}, server/asobj/LocalConnection.cpp,

Index: server/asobj/string.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/string.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- server/asobj/string.cpp     21 Jan 2008 20:55:58 -0000      1.50
+++ server/asobj/string.cpp     25 Jan 2008 20:42:40 -0000      1.51
@@ -16,7 +16,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: string.cpp,v 1.50 2008/01/21 20:55:58 rsavoye Exp $ */
+/* $Id: string.cpp,v 1.51 2008/01/25 20:42:40 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "gnashconfig.h"
@@ -317,10 +317,9 @@
     }
 
 
-    //if (delim == "") {
     if ( delim.empty() ) {
         for (unsigned i=0; i <max; i++) {
-            val.set_std_string(str.substr(i, i+1));
+            val.set_std_string(str.substr(i, 1));
             array->push(val);
         }
 

Index: testsuite/actionscript.all/String.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/String.as,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- testsuite/actionscript.all/String.as        15 Jan 2008 11:35:49 -0000      
1.34
+++ testsuite/actionscript.all/String.as        25 Jan 2008 20:42:40 -0000      
1.35
@@ -16,7 +16,7 @@
 
 // Original author: Mike Carlson - June 19th, 2006
 
-rcsid="$Id: String.as,v 1.34 2008/01/15 11:35:49 strk Exp $";
+rcsid="$Id: String.as,v 1.35 2008/01/25 20:42:40 strk Exp $";
 
 #include "check.as"
 
@@ -146,8 +146,17 @@
 check_equals ( a.split("  w").length, 1);
 
 #if OUTPUT_VERSION > 5
-check_equals ( a.split("")[0], "w" );
-check_equals ( a.split("")[19], "N" );
+// TODO: check more of split(''), it seems to be bogus !
+ret = a.split('');
+check_equals(typeof(ret), 'object');
+check(ret instanceof Array);
+check_equals( ret.length, 20 );
+check_equals ( ret[0], "w" );
+check_equals ( ret[1], "a" );
+check_equals ( ret[2], "l" );
+check_equals ( ret[3], "l" );
+check_equals ( ret[18], "O" );
+check_equals ( ret[19], "N" );
 check_equals ( a.split("la")[0], "wal" );
 check_equals ( a.split("la")[1], "wal" );
 check_equals ( a.split("la")[2], "washinGTON" );
@@ -475,5 +484,5 @@
 #if OUTPUT_VERSION < 6
  check_totals(175);
 #else
- check_totals(196);
+ check_totals(203);
 #endif




reply via email to

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