seed r819 - trunk/libseed



Author: racarr
Date: Thu Jan 29 18:24:05 2009
New Revision: 819
URL: http://svn.gnome.org/viewvc/seed?rev=819&view=rev

Log:
Implement seed_value_is_null seed_value_is_object and seed_object_is_function

Modified:
   trunk/libseed/seed-api.c
   trunk/libseed/seed-engine.c
   trunk/libseed/seed.h

Modified: trunk/libseed/seed-api.c
==============================================================================
--- trunk/libseed/seed-api.c	(original)
+++ trunk/libseed/seed-api.c	Thu Jan 29 18:24:05 2009
@@ -172,3 +172,23 @@
 {
 	JSObjectSetPrivate(object, value);
 }
+
+gboolean seed_value_is_null(JSContextRef ctx,
+			    JSValueRef value)
+{
+	return JSValueIsNull(ctx, value);
+}
+
+gboolean seed_value_is_object(JSContextRef ctx,
+			      JSValueRef value)
+{
+	return seed_value_is_null(ctx, value) &&
+		JSValueIsObject(ctx, value);
+}
+gboolean seed_value_is_function(JSContextRef ctx,
+				 JSObjectRef value)
+{
+	return seed_value_is_object(ctx, value) && 
+		JSObjectIsFunction(ctx, value);
+}
+

Modified: trunk/libseed/seed-engine.c
==============================================================================
--- trunk/libseed/seed-engine.c	(original)
+++ trunk/libseed/seed-engine.c	Thu Jan 29 18:24:05 2009
@@ -875,6 +875,8 @@
 	JSStringRef extension_script;
 	gint n, i;
 	GModule *extension;
+	
+	ctx = eng->context;
 
 	if (argumentCount == 0)
 	{
@@ -1381,7 +1383,7 @@
 	g_type_init();
 	g_log_set_handler("GLib-GObject", G_LOG_LEVEL_WARNING, seed_log_handler, 0);
 
-	if (seed_parse_args(argc, argv) == FALSE)
+	if ((argc != 0) && seed_parse_args(argc, argv) == FALSE)
 	{
 		SEED_NOTE(MISC, "failed to parse arguments.");
 		return false;

Modified: trunk/libseed/seed.h
==============================================================================
--- trunk/libseed/seed.h	(original)
+++ trunk/libseed/seed.h	Thu Jan 29 18:24:05 2009
@@ -110,6 +110,13 @@
 gboolean seed_string_is_equal(SeedString a, SeedString b);
 gboolean seed_string_is_equal_utf8(SeedString a, const gchar * b);
 
+gboolean seed_value_is_null(SeedContext ctx,
+			    SeedValue value);
+gboolean seed_value_is_object(SeedContext ctx,
+			      SeedValue value);
+gboolean seed_value_is_function(SeedContext ctx,
+				 SeedObject value);
+
 SeedValue seed_object_call(SeedContext ctx,
 						   SeedObject object,
 						   SeedObject this,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]