[seed] [libseed] Added seed_value_is_object_of_class()
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] [libseed] Added seed_value_is_object_of_class()
- Date: Fri, 3 Jul 2009 08:43:04 +0000 (UTC)
commit 7acd9008ae3d901d02a3d745ed52c8a0d0761035
Author: Matt ARSENAULT <arsenm2 rpi edu>
Date: Fri Jul 3 00:52:02 2009 -0400
[libseed] Added seed_value_is_object_of_class()
libseed/seed-api.c | 15 +++++++++++++++
libseed/seed.h | 1 +
2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/libseed/seed-api.c b/libseed/seed-api.c
index e302fff..493b378 100644
--- a/libseed/seed-api.c
+++ b/libseed/seed-api.c
@@ -506,6 +506,21 @@ seed_value_is_object (JSContextRef ctx, JSValueRef value)
}
/**
+ * seed_value_is_object_of_class:
+ * @ctx: A #SeedContext.
+ * @value: A #SeedValue.
+ * @klass: A #SeedClass.
+ *
+ * Return value: #true if @value is an object of specified class, #false otherwise.
+ *
+ */
+gboolean
+seed_value_is_object_of_class (JSContextRef ctx, JSValueRef value, JSClassRef klass)
+{
+ return !seed_value_is_null (ctx, value) && JSValueIsObjectOfClass (ctx, value, klass);
+}
+
+/**
* seed_value_is_function:
* @ctx: A #SeedContext.
* @value: A #SeedObject.
diff --git a/libseed/seed.h b/libseed/seed.h
index 42ff873..42cc423 100644
--- a/libseed/seed.h
+++ b/libseed/seed.h
@@ -129,6 +129,7 @@ gboolean seed_string_is_equal_utf8 (SeedString a, const gchar * b);
gboolean seed_value_is_null (SeedContext ctx, SeedValue value);
gboolean seed_value_is_undefined (SeedContext ctx, SeedValue value);
gboolean seed_value_is_object (SeedContext ctx, SeedValue value);
+gboolean seed_value_is_object_of_class (SeedContext ctx, SeedValue value, SeedClass klass);
gboolean seed_value_is_function (SeedContext ctx, SeedObject value);
gboolean seed_value_is_string (SeedContext ctx, SeedValue value);
gboolean seed_value_is_number (SeedContext ctx, SeedValue value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]