[Top][All Lists]
[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, 26 Oct 2007 08:26:54 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/10/26 08:26:54
Modified files:
. : ChangeLog
server/asobj : string.cpp
testsuite/actionscript.all: Date.as String.as
Log message:
* server/asobj/string.cpp: fix substring(0,1).
* testsuite/actionscript.all/String.as: test substring(0,1)
* testsuite/actionscript.all/Date.as: add test for adding Date
instance to a number.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4716&r2=1.4717
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/string.cpp?cvsroot=gnash&r1=1.40&r2=1.41
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Date.as?cvsroot=gnash&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/String.as?cvsroot=gnash&r1=1.25&r2=1.26
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4716
retrieving revision 1.4717
diff -u -b -r1.4716 -r1.4717
--- ChangeLog 26 Oct 2007 07:39:47 -0000 1.4716
+++ ChangeLog 26 Oct 2007 08:26:53 -0000 1.4717
@@ -1,5 +1,12 @@
2007-10-26 Sandro Santilli <address@hidden>
+ * server/asobj/string.cpp: fix substring(0,1).
+ * testsuite/actionscript.all/String.as: test substring(0,1)
+ * testsuite/actionscript.all/Date.as: add test for adding Date
+ instance to a number.
+
+2007-10-26 Sandro Santilli <address@hidden>
+
* server/as_object.h: add virtual isDateObject() method.
* server/asobj/Date.cpp: implement isDateObject, have valueOf
always return a number.
Index: server/asobj/string.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/string.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- server/asobj/string.cpp 24 Oct 2007 23:26:24 -0000 1.40
+++ server/asobj/string.cpp 26 Oct 2007 08:26:54 -0000 1.41
@@ -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.40 2007/10/24 23:26:24 strk Exp $ */
+/* $Id: string.cpp,v 1.41 2007/10/26 08:26:54 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -395,7 +395,7 @@
return as_value("");
}
- if (num > 1 && static_cast<unsigned>(num) < str.size()) {
+ if (num >= 1 && static_cast<unsigned>(num) < str.size()) {
end = num;
if (end < start) {
@@ -410,6 +410,8 @@
}
+ //log_debug("Start: %d, End: %d", start, end);
+
return as_value(str.substr(start, end));
}
Index: testsuite/actionscript.all/Date.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Date.as,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- testsuite/actionscript.all/Date.as 25 Oct 2007 22:27:06 -0000 1.31
+++ testsuite/actionscript.all/Date.as 26 Oct 2007 08:26:54 -0000 1.32
@@ -21,7 +21,7 @@
// compile this test case with Ming makeswf, and then
// execute it like this gnash -1 -r 0 -v out.swf
-rcsid="$Id: Date.as,v 1.31 2007/10/25 22:27:06 strk Exp $";
+rcsid="$Id: Date.as,v 1.32 2007/10/26 08:26:54 strk Exp $";
#include "check.as"
@@ -519,12 +519,19 @@
// Check if Date, concatenated to a string, is in human readable form
d = new Date(2000, 1, 15, 0, 0, 0);
var foo = "foo "+d;
+var bar = 0+d;
check_equals(typeof(foo), 'string');
-// correct: "foo Tue Feb 15 00:00:00 GMT+0100 2000"
-// but this probably depends on time zone, so just check for some fixed part..
#if OUTPUT_VERSION > 5
+ // correct: "0Tue Feb 15 00:00:00 GMT+0100 2000"
+ // but this probably depends on time zone, so just check for some fixed part..
+ check_equals(typeof(bar), 'string');
+ check_equals(bar.substring(0, 1), '0');
+ check_equals(bar.indexOf("Feb"), 5);
+ // correct: "foo Tue Feb 15 00:00:00 GMT+0100 2000"
+ // but this probably depends on time zone, so just check for some fixed part..
check_equals(foo.indexOf("Feb"), 8);
#else
+ check_equals(typeof(bar), 'number');
// correct: "foo 950569200000"
check_equals(foo.substring(0, 10), 'foo 950569');
#endif
Index: testsuite/actionscript.all/String.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/String.as,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- testsuite/actionscript.all/String.as 6 Oct 2007 07:08:52 -0000
1.25
+++ testsuite/actionscript.all/String.as 26 Oct 2007 08:26:54 -0000
1.26
@@ -16,7 +16,7 @@
// Original author: Mike Carlson - June 19th, 2006
-rcsid="$Id: String.as,v 1.25 2007/10/06 07:08:52 strk Exp $";
+rcsid="$Id: String.as,v 1.26 2007/10/26 08:26:54 strk Exp $";
#include "check.as"
@@ -273,6 +273,7 @@
check_equals (a_string.substring(0, 4), "a_st");
check_equals (a_string.substring(-3, 4), "a_st");
check_equals (a_string.substring(0, -1), "");
+check_equals (a_string.substring(0, 1), "a");
check_equals (a_string.substring(4), "ring");
check_equals (a_string.substring(16), "");
check_equals (a_string.substring(-16), "a_string");
@@ -280,6 +281,8 @@
check_equals (a_string.indexOf("hing"), -1 );
check_equals (a_string.indexOf("string"), 2 );
check_equals (a_string.charCodeAt(0), 97 );
+a_string = ""; // empty
+check_equals (a_string.substring(0, 1), "");
// Test String.length not being overridable
a_string = "1234567890";