Index: /CKPackager/trunk/_source/includes/scriptcompressor.js
===================================================================
--- /CKPackager/trunk/_source/includes/scriptcompressor.js	(revision 4670)
+++ /CKPackager/trunk/_source/includes/scriptcompressor.js	(revision 4671)
@@ -77,5 +77,5 @@
 
 	// Tokens having right-to-left associativity.
-	// From http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Operators:Operator_Precedence
+	// From https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Operators/Operator_Precedence
 	var associativityRTL = {};
 	associativityRTL[ Token.SETNAME ] =
@@ -242,5 +242,12 @@
 					{
 						out( '=' );
+
+						if ( child.getFirstChild().getType() == Token.COMMA )
+							out( '(' );
+
 						writeChildren( child );
+
+						if ( child.getFirstChild().getType() == Token.COMMA )
+							out( ')' );
 					}
 
@@ -290,5 +297,13 @@
 					default :
 						out( '=' );
+
+						if ( value.getType() == Token.COMMA )
+							out( '(' );
+
 						writeNode( value );
+
+						if ( value.getType() == Token.COMMA )
+							out( ')' );
+
 						break;
 				}
@@ -430,6 +445,12 @@
 				while( param )
 				{
+					if ( param.getType() == Token.COMMA )
+						out( '(' );
+
 					if ( !writeNode( param ) )
 						break;
+
+					if ( param.getType() == Token.COMMA )
+						out( ')' );
 
 					param = param.getNext();
@@ -1116,6 +1137,5 @@
 
 				// The right side.
-				if ( !parenthesis )
-					parenthesis = ( precedence[ type ] < ( precedence[ right.getType() ] || 0 ) );
+				parenthesis = ( precedence[ type ] < ( precedence[ right.getType() ] || 0 ) );
 
 				if ( !parenthesis && !associativityRTL[ type ] && !noAssociativity[ type ] )
Index: /CKPackager/trunk/test/test.js
===================================================================
--- /CKPackager/trunk/test/test.js	(revision 4670)
+++ /CKPackager/trunk/test/test.js	(revision 4671)
@@ -290,8 +290,19 @@
 
 		[	"var a=(b=c)?d:e;" ],
-				
+
 		[	"if(a){for(;;){if(B){doB();}}}else{doC();}",
-			"if(a)for(;;){if(B)doB();}else doC();"
-		]
+			"if(a)for(;;){if(B)doB();}else doC();" ],
+
+		[	"a((1,2),3);" ],
+
+		[	"(1,2)+3;" ],
+
+		[	"3+(1,2);" ],
+
+		[	"(1,2);", "1,2;" ],
+
+		[	"var a=(1,2,3,4);" ],
+
+		[	"a=(1,2,3,4);" ]
 	];
 
