]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
GIR writer: Generate throws attribute
authorDidier 'Ptitjes <ptitjes@free.fr>
Sat, 21 Mar 2009 05:05:03 +0000 (06:05 +0100)
committerJürg Billeter <j@bitron.ch>
Thu, 30 Apr 2009 21:39:29 +0000 (23:39 +0200)
Generate throws attribute on constructors, methods and callbacks.

Signed-off-by: Didier 'Ptitjes <ptitjes@free.fr>
gobject/valagirwriter.vala

index 53ef7eb1e145b5399b8b323c64a7decbb6714444..c6bad7a191cd449d27d747b7c6e4943cb064e4ac 100644 (file)
@@ -469,6 +469,9 @@ public class Vala.GIRWriter : CodeVisitor {
                write_indent ();
                stream.printf ("<callback name=\"%s\"", cb.name);
                stream.printf (" c:type=\"%s\"", cb.get_cname ());
+               if (cb.tree_can_fail) {
+                       stream.printf (" throws=\"1\"");
+               }
                stream.printf (">\n");
                indent++;
 
@@ -514,6 +517,9 @@ public class Vala.GIRWriter : CodeVisitor {
                } else {
                        stream.printf (" c:identifier=\"%s\"", m.get_cname ());
                }
+               if (m.tree_can_fail) {
+                       stream.printf (" throws=\"1\"");
+               }
                stream.printf (">\n");
                indent++;
 
@@ -542,6 +548,9 @@ public class Vala.GIRWriter : CodeVisitor {
 
                write_indent ();
                stream.printf ("<constructor name=\"%s\" c:identifier=\"%s\"", m.name, m.get_cname ());
+               if (m.tree_can_fail) {
+                       stream.printf (" throws=\"1\"");
+               }
                stream.printf (">\n");
                indent++;