[vala] dova: Add support for [NoThrow] methods



commit b0077cd7a3156af3ad2d51da2fd9164c0aa0c176
Author: Jürg Billeter <j bitron ch>
Date:   Thu Aug 19 11:25:41 2010 +0200

    dova: Add support for [NoThrow] methods

 vala/valacodewriter.vala |    4 ++++
 vala/valamethod.vala     |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala
index 5b8ada0..f1b9d24 100644
--- a/vala/valacodewriter.vala
+++ b/vala/valacodewriter.vala
@@ -941,6 +941,10 @@ public class Vala.CodeWriter : CodeVisitor {
 			write_indent ();
 			write_string ("[NoWrapper]");
 		}
+		if (m.get_attribute ("NoThrow") != null) {
+			write_indent ();
+			write_string ("[NoThrow]");
+		}
 		if (m.returns_modified_pointer) {
 			write_indent ();
 			write_string ("[ReturnsModifiedPointer]");
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index 5119c03..29f30ab 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -502,6 +502,8 @@ public class Vala.Method : Symbol {
 				no_array_length = true;
 			} else if (a.name == "Deprecated") {
 				process_deprecated_attribute (a);
+			} else if (a.name == "NoThrow") {
+				get_error_types ().clear ();
 			}
 		}
 	}



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