seed r151 - in trunk: libseed tests
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r151 - in trunk: libseed tests
- Date: Fri, 7 Nov 2008 04:42:05 +0000 (UTC)
Author: racarr
Date: Fri Nov 7 04:42:04 2008
New Revision: 151
URL: http://svn.gnome.org/viewvc/seed?rev=151&view=rev
Log:
Check if value is Object before checking if object is function. Add
gtype definition test.
Added:
trunk/tests/gtype.js (contents, props changed)
Modified:
trunk/libseed/seed-gtype.c
trunk/tests/Makefile.am
Modified: trunk/libseed/seed-gtype.c
==============================================================================
--- trunk/libseed/seed-gtype.c (original)
+++ trunk/libseed/seed-gtype.c Fri Nov 7 04:42:04 2008
@@ -162,11 +162,13 @@
" GObject type for parent");
}
if (!JSValueIsNull(eng->context, class_init) &&
+ JSValueIsObject(eng->context, class_init) &&
JSObjectIsFunction(eng->context, (JSObjectRef)class_init))
{
init_closure = seed_make_class_init_closure((JSObjectRef)class_init);
}
if (!JSValueIsNull(eng->context, instance_init) &&
+ JSValueIsObject(eng->context, instance_init) &&
JSObjectIsFunction(eng->context, (JSObjectRef)instance_init))
{
instance_init_closure =
@@ -185,8 +187,6 @@
new_name,
&type_info, 0);
seed_gobject_get_class_for_gtype(new_type);
- printf("Type_name: %s \n", g_type_name(new_type));
-
g_free(new_name);
return JSObjectMake(eng->context, gobject_constructor_class,
Modified: trunk/tests/Makefile.am
==============================================================================
--- trunk/tests/Makefile.am (original)
+++ trunk/tests/Makefile.am Fri Nov 7 04:42:04 2008
@@ -1,6 +1,7 @@
EXTRA_DIST = \
argv.js \
compare.js \
+ gtype.js \
enum.js \
gobject-scope.js \
include.js \
Added: trunk/tests/gtype.js
==============================================================================
--- (empty file)
+++ trunk/tests/gtype.js Fri Nov 7 04:42:04 2008
@@ -0,0 +1,28 @@
+#!/usr/local/bin/seed
+// Returns: 0
+// STDIN:
+// STDOUT:In constructor for \[object HelloWindow\]\nIn map, verifying widget\.title : Hello!
+// STDERR:
+
+Seed.import_namespace("Gtk");
+Gtk.init(null, null);
+
+HelloWindowType = {
+ parent: Gtk.Window,
+ name: "HelloWindow",
+ instance_init: function(widget, klass)
+ {
+ widget.title = "Hello!";
+ Seed.print("In constructor for " + widget);
+ }};
+
+HelloWindow = new GType(HelloWindowType);
+w = new HelloWindow();
+w.signal.map.connect(
+ function(widget)
+ {
+ Seed.print("In map, verifying widget.title : "
+ + widget.title)
+ });
+w.show();
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]