gjs r66 - in trunk: gi test/js
- From: walters svn gnome org
- To: svn-commits-list gnome org
- Subject: gjs r66 - in trunk: gi test/js
- Date: Thu, 30 Oct 2008 20:01:35 +0000 (UTC)
Author: walters
Date: Thu Oct 30 20:01:35 2008
New Revision: 66
URL: http://svn.gnome.org/viewvc/gjs?rev=66&view=rev
Log:
Throw exception when passing negative numbers for unsigned args
Modified:
trunk/gi/arg.c
trunk/test/js/testEverythingBasic.js
Modified: trunk/gi/arg.c
==============================================================================
--- trunk/gi/arg.c (original)
+++ trunk/gi/arg.c Thu Oct 30 20:01:35 2008
@@ -281,6 +281,8 @@
double v;
if (!JS_ValueToNumber(context, value, &v))
wrong = TRUE;
+ if (v < 0)
+ out_of_range = TRUE;
/* XXX we fail with values close to G_MAXUINT64 */
arg->v_uint64 = v;
}
Modified: trunk/test/js/testEverythingBasic.js
==============================================================================
--- trunk/test/js/testEverythingBasic.js (original)
+++ trunk/test/js/testEverythingBasic.js Thu Oct 30 20:01:35 2008
@@ -62,8 +62,7 @@
assertRaises(function() { return Everything.test_uint16(-42); });
assertRaises(function() { return Everything.test_uint32(-42); });
- // FAIL: returns 18446744073709552000 instead of raising exception
- //assertRaises(function() { return Everything.test_uint64(-42); });
+ assertRaises(function() { return Everything.test_uint64(-42); });
assertRaises(function() { return Everything.test_uint(-42); });
assertRaises(function() { return Everything.test_size(-42); });
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]