diff scripts/dgen.rb @ 15:7ff919f595d5

Added the Foundation framework, again
author Jacob Carlborg <doob@me.com>
date Mon, 03 Aug 2009 15:31:48 +0200
parents 4f583f7e242e
children 19885b43130e
line wrap: on
line diff
--- a/scripts/dgen.rb	Mon Aug 03 15:23:15 2009 +0200
+++ b/scripts/dgen.rb	Mon Aug 03 15:31:48 2009 +0200
@@ -1137,12 +1137,8 @@
 				str << ", " unless i == method.arg.length - 1
 			end unless method.arg.nil?			
 			
-			if return_type == class_name
-				str << "return result is this.objcObject ? this : (result !is null ? new #{return_type}(result) : null);"
-			else
-				str << ")".nl
-			end
-			
+			str << ")".nl
+			str << "return result is this.objcObject ? this : (result !is null ? new #{return_type}(result) : null)".indent(2).nl if return_type == class_name && !static
 			str << "}".indent.nl(false).nl(false)
 			
 			if name.length >= 4 && name[0 ... 4] == "init" && name != "initialize"