seed r382 - trunk/libseed
- From: hortont svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r382 - trunk/libseed
- Date: Mon, 1 Dec 2008 03:17:41 +0000 (UTC)
Author: hortont
Date: Mon Dec 1 03:17:41 2008
New Revision: 382
URL: http://svn.gnome.org/viewvc/seed?rev=382&view=rev
Log:
Fix Seed.quit. Allow arbitrary exit codes...
Modified:
trunk/libseed/seed-builtins.c
Modified: trunk/libseed/seed-builtins.c
==============================================================================
--- trunk/libseed/seed-builtins.c (original)
+++ trunk/libseed/seed-builtins.c Mon Dec 1 03:17:41 2008
@@ -279,12 +279,17 @@
size_t argumentCount,
const JSValueRef arguments[], JSValueRef * exception)
{
- if (argumentCount != 0)
+ if (argumentCount == 1)
{
- if (!seed_value_to_int(ctx, arguments[0], NULL))
- exit(EXIT_SUCCESS);
- else
- exit(EXIT_FAILURE);
+ exit(seed_value_to_int(ctx, arguments[0], NULL));
+ }
+ else if(argumentCount > 1)
+ {
+ gchar *mes = g_strdup_printf("Seed.quit expected "
+ "1 argument, got %d",
+ argumentCount);
+ seed_make_exception(ctx, exception, "ArgumentError", mes);
+ g_free(mes);
}
exit(EXIT_SUCCESS);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]