[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/as_value.cpp testsuite/m...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/as_value.cpp testsuite/m... |
Date: |
Tue, 01 Apr 2008 23:33:33 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/04/01 23:33:33
Modified files:
. : ChangeLog
server : as_value.cpp
testsuite/misc-swfc.all: swf4opcode.sc
Log message:
* server/as_value.cpp (to_number): in swf<5 a astring can
convert to a number as long as it starts with digits; leading
non-digits won't yeld a NaN. Fixes bug #20911.
* testsuite/misc-swfc.all/swf4opcode.sc: test convertion of
strings containing leading non-digits to number.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6145&r2=1.6146
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_value.cpp?cvsroot=gnash&r1=1.126&r2=1.127
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-swfc.all/swf4opcode.sc?cvsroot=gnash&r1=1.6&r2=1.7
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6145
retrieving revision 1.6146
diff -u -b -r1.6145 -r1.6146
--- ChangeLog 1 Apr 2008 22:44:43 -0000 1.6145
+++ ChangeLog 1 Apr 2008 23:33:32 -0000 1.6146
@@ -1,3 +1,11 @@
+2008-04-01 Sandro Santilli <address@hidden>
+
+ * server/as_value.cpp (to_number): in swf<5 a astring can
+ convert to a number as long as it starts with digits; leading
+ non-digits won't yeld a NaN. Fixes bug #20911.
+ * testsuite/misc-swfc.all/swf4opcode.sc: test convertion of
+ strings containing leading non-digits to number.
+
2008-04-01 Benjamin Wolsey <address@hidden>
* server/asobj/Date.cpp: drop ctime methods as time_t is not up to
Index: server/as_value.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_value.cpp,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -b -r1.126 -r1.127
--- server/as_value.cpp 31 Mar 2008 07:13:59 -0000 1.126
+++ server/as_value.cpp 1 Apr 2008 23:33:32 -0000 1.127
@@ -397,6 +397,14 @@
}
}
+ else if(swfversion <= 4)
+ {
+ const std::string& s = getStr();
+ const char* nptr = s.c_str();
+ char* endptr = NULL;
+ double d = strtod(nptr, &endptr);
+ return d;
+ }
// @@ Moock says the rule here is: if the
// string is a valid float literal, then it
@@ -412,8 +420,7 @@
// just like for any other non-numerical text. This is correct
// behaviour.
{
- if(swfversion <= 4) return (double)0.0;
- else return (double)NAN;
+ return (double)NAN;
}
}
Index: testsuite/misc-swfc.all/swf4opcode.sc
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-swfc.all/swf4opcode.sc,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- testsuite/misc-swfc.all/swf4opcode.sc 21 Nov 2007 19:35:55 -0000
1.6
+++ testsuite/misc-swfc.all/swf4opcode.sc 1 Apr 2008 23:33:32 -0000
1.7
@@ -106,6 +106,24 @@
.frame 2
.action:
+
+ //
+ // test convertion to number (and thus bool)
+ //
+ x = '2/';
+ y = '3/';
+ // x and y are converted to number 0 before comparision
+ check_equals( (x+y), 5 );
+ check( y > x );
+ neg = !x;
+ check(!neg);
+ neg = !y;
+ check(!neg);
+ y = '/';
+ check_equals( y, 0 );
+ y = ' 4';
+ check_equals( y, 4 );
+
//
// test ActionLessThan
//
- [Gnash-commit] gnash ChangeLog server/as_value.cpp testsuite/m...,
Sandro Santilli <=