Index: /trunk/Decompiler.class.php
===================================================================
--- /trunk/Decompiler.class.php	(revision 740)
+++ /trunk/Decompiler.class.php	(revision 741)
@@ -12,7 +12,5 @@
 {
 	if (is_object($code)) {
-		if (get_class($code) != 'Decompiler_Code') {
-			$code = toCode($code, $indent);
-		}
+		$code = toCode($code, $indent);
 		return $code->__toString();
 	}
@@ -21,5 +19,5 @@
 }
 // }}}
-function toCode($src, $indent = '') // {{{
+function toCode($src, $indent = '') // {{{ wrap or rewrap anything to Decompiler_Code
 {
 	if (is_array($indent)) {
@@ -27,13 +25,18 @@
 	}
 
-	if (is_object($src)) {
-		if (!method_exists($src, 'toCode')) {
-			var_dump($src);
-			exit('no toCode');
-		}
-		return new Decompiler_Code($src->toCode($indent));
-	}
-
-	return new Decompiler_Code($src);
+	if (!is_object($src)) {
+		return new Decompiler_Code($src);
+	}
+
+	if (!method_exists($src, 'toCode')) {
+		var_dump($src);
+		exit('no toCode');
+	}
+	if (get_class($src) != 'Decompiler_Code') {
+		// rewrap it
+		$src = new Decompiler_Code($src->toCode($indent));
+	}
+
+	return $src;
 }
 // }}}
@@ -91,5 +94,5 @@
 	function toCode($indent)
 	{
-		return $this;
+		return $this->src;
 	}
 
