vala r1065 - in trunk: . gobject tests



Author: juergbi
Date: Fri Feb 29 20:46:07 2008
New Revision: 1065
URL: http://svn.gnome.org/viewvc/vala?rev=1065&view=rev

Log:
2008-02-29  Juerg Billeter  <j bitron ch>

	* gobject/valaccodegenerator.vala: fix try catch statements without
	  thrown exceptions, fixes bug 506016

	* tests/exceptions.vala: test try catch statements without errors


Modified:
   trunk/ChangeLog
   trunk/gobject/valaccodegenerator.vala
   trunk/tests/exceptions.vala

Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala	(original)
+++ trunk/gobject/valaccodegenerator.vala	Fri Feb 29 20:46:07 2008
@@ -1302,6 +1302,8 @@
 	}
 
 	private void add_simple_check (CodeNode! node, CCodeFragment! cfrag) {
+		current_method_inner_error = true;
+
 		var cprint_frag = new CCodeFragment ();
 		var ccritical = new CCodeFunctionCall (new CCodeIdentifier ("g_critical"));
 		ccritical.add_argument (new CCodeConstant ("\"file %s: line %d: uncaught error: %s\""));
@@ -2160,6 +2162,8 @@
 	}
 
 	public override void visit_catch_clause (CatchClause! clause) {
+		current_method_inner_error = true;
+
 		clause.accept_children (this);
 
 		var cfrag = new CCodeFragment ();

Modified: trunk/tests/exceptions.vala
==============================================================================
--- trunk/tests/exceptions.vala	(original)
+++ trunk/tests/exceptions.vala	Fri Feb 29 20:46:07 2008
@@ -98,6 +98,13 @@
 		assert_not_reached ();
 	}
 
+	static void test_try_without_error () {
+		try {
+		} catch (Error e) {
+			assert_not_reached ();
+		}
+	}
+
 	static int main (string[] args) {
 		stdout.printf ("Exception Test: 1");
 		



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