[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/asobj/Global.cpp testsui...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog server/asobj/Global.cpp testsui... |
Date: |
Tue, 25 Mar 2008 16:23:11 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/03/25 16:23:10
Modified files:
. : ChangeLog
server/asobj : Global.cpp
testsuite/actionscript.all: Global.as
Log message:
* testsuite/actionscript.all/Global.as: more passes, some new
(now passing) tests for parseint.
* server/asobj/global.cpp: fix parseint, pass all
actionscript.all
parseint tests; the now single discrepancy in swfdec
parse-int*
seems not directly related to parseint at all.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6020&r2=1.6021
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Global.cpp?cvsroot=gnash&r1=1.97&r2=1.98
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Global.as?cvsroot=gnash&r1=1.47&r2=1.48
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6020
retrieving revision 1.6021
diff -u -b -r1.6020 -r1.6021
--- ChangeLog 24 Mar 2008 21:46:46 -0000 1.6020
+++ ChangeLog 25 Mar 2008 16:23:09 -0000 1.6021
@@ -1,3 +1,11 @@
+2008-03-25 Benjamin Wolsey <address@hidden>
+
+ * testsuite/actionscript.all/Global.as: more passes, some new
+ (now passing) tests for parseint.
+ * server/asobj/global.cpp: fix parseint, pass all actionscript.all
+ parseint tests; the now single discrepancy in swfdec parse-int*
+ seems not directly related to parseint at all.
+
2008-03-24 Markus Gothe <address@hidden>
* server/as_envoronment.cpp: Fixed signedness of int.
Index: server/asobj/Global.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Global.cpp,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -b -r1.97 -r1.98
--- server/asobj/Global.cpp 18 Mar 2008 22:47:38 -0000 1.97
+++ server/asobj/Global.cpp 25 Mar 2008 16:23:10 -0000 1.98
@@ -222,22 +222,6 @@
std::string::const_iterator it = expr.begin();
-
- // if we were sent a second argument, that's our base
- if (fn.nargs > 1)
- {
- base = (fn.arg(1).to_int());
-
- // Bases from 2 to 36 are valid, otherwise return NaN
- if (base < 2 || base > 36)
- {
- as_value rv;
- rv.set_nan();
- return rv;
- }
- }
- else
- {
// Try hexadecimal first
if (expr.substr(0, 2) == "0x" || expr.substr(0, 2) == "0X")
{
@@ -304,6 +288,24 @@
}
else if (*it == '+') it++;
}
+
+ // After all that, a second argument specifies the base.
+ // Parsing still starts after any positive/negative
+ // sign or hex identifier (parseInt("0x123", 8) gives
+ // 83, not 0; parseInt(" 0x123", 8) is 0), which is
+ // why we do this here.
+ if (fn.nargs > 1)
+ {
+ base = (fn.arg(1).to_int());
+
+ // Bases from 2 to 36 are valid, otherwise return NaN
+ if (base < 2 || base > 36)
+ {
+ as_value rv;
+ rv.set_nan();
+ return rv;
+ }
+
}
// Now we have the base, parse the digits. The iterator should
@@ -324,7 +326,7 @@
// until we reach the end of the string or an invalid character,
// adding valid characters to our result.
// Which characters are invalid depends on the base.
- int result = digit;
+ double result = digit;
++it;
while (it != expr.end() && (digit = digits.find(toupper(*it))) < base
Index: testsuite/actionscript.all/Global.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Global.as,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- testsuite/actionscript.all/Global.as 18 Mar 2008 22:47:38 -0000
1.47
+++ testsuite/actionscript.all/Global.as 25 Mar 2008 16:23:10 -0000
1.48
@@ -22,7 +22,7 @@
// execute it like this gnash -1 -r 0 -v out.swf
-rcsid="$Id: Global.as,v 1.47 2008/03/18 22:47:38 bwy Exp $";
+rcsid="$Id: Global.as,v 1.48 2008/03/25 16:23:10 bwy Exp $";
#include "check.as"
#if OUTPUT_VERSION > 5
@@ -113,9 +113,13 @@
check(isNaN(parseInt("8589934592", 5)));
-// Er...
-xcheck_equals(parseInt("8589934592", 16), 573538780562);
-xcheck_equals(parseInt("800000000", 36), 22568879259648);
+
+// Misc
+check_equals(parseInt("8589934592", 16), 573538780562);
+check_equals(parseInt("800000000", 36), 22568879259648);
+check_equals(parseInt(" 6 7 8", 8), 6);
+check_equals(parseInt("0x123", 8), 83);
+check_equals(parseInt(" 0x123", 8), 0);
// It's not reliable to compare a double type with ==, so we'll give it a
// small range using >= and <=
@@ -406,15 +410,15 @@
//------------------------------------------------------------
#if OUTPUT_VERSION == 5
- check_totals(113); // SWF5
+ check_totals(116); // SWF5
#else
# if OUTPUT_VERSION == 6
- check_totals(147); // SWF6
+ check_totals(150); // SWF6
# else
# if OUTPUT_VERSION == 7
- check_totals(129); // SWF7
+ check_totals(132); // SWF7
# else
- check_totals(116); // SWF8+
+ check_totals(119); // SWF8+
# endif
# endif
#endif
- [Gnash-commit] gnash ChangeLog server/asobj/Global.cpp testsui...,
Benjamin Wolsey <=