Index: lang/javascript/deflate/trunk/rawinflate.js
===================================================================
--- lang/javascript/deflate/trunk/rawinflate.js (revision 30673)
+++ lang/javascript/deflate/trunk/rawinflate.js (revision 30674)
@@ -73,10 +73,10 @@
 /* objects (inflate) */
 
-function zip_HuftList() {
+var zip_HuftList = function() {
     this.next = null;
     this.list = null;
 }
 
-function zip_HuftNode() {
+var zip_HuftNode = function() {
     this.e = 0; // number of extra bits or operation
     this.b = 0; // number of bits in this code or subcode
@@ -87,5 +87,5 @@
 }
 
-function zip_HuftBuild(b,	// code lengths in bits (all assumed <= BMAX)
+var zip_HuftBuild = function(b,	// code lengths in bits (all assumed <= BMAX)
 		       n,	// number of codes (assumed <= N_MAX)
 		       s,	// number of simple-valued codes (0..s-1)
@@ -313,5 +313,5 @@
 /* routines (inflate) */
 
-function zip_GET_BYTE() {
+var zip_GET_BYTE = function() {
     if(zip_inflate_data.length == zip_inflate_pos)
 	return -1;
@@ -319,5 +319,5 @@
 }
 
-function zip_NEEDBITS(n) {
+var zip_NEEDBITS = function(n) {
     while(zip_bit_len < n) {
 	zip_bit_buf |= zip_GET_BYTE() << zip_bit_len;
@@ -326,14 +326,14 @@
 }
 
-function zip_GETBITS(n) {
+var zip_GETBITS = function(n) {
     return zip_bit_buf & zip_MASK_BITS[n];
 }
 
-function zip_DUMPBITS(n) {
+var zip_DUMPBITS = function(n) {
     zip_bit_buf >>= n;
     zip_bit_len -= n;
 }
 
-function zip_inflate_codes(buff, off, size) {
+var zip_inflate_codes = function(buff, off, size) {
     /* inflate (decompress) the codes in a deflated (compressed) block.
        Return an error code or zero if it all goes ok. */
@@ -417,5 +417,5 @@
 }
 
-function zip_inflate_stored(buff, off, size) {
+var zip_inflate_stored = function(buff, off, size) {
     /* "decompress" an inflated type 0 (stored) block. */
     var n;
@@ -452,5 +452,5 @@
 }
 
-function zip_inflate_fixed(buff, off, size) {
+var zip_inflate_fixed = function(buff, off, size) {
     /* decompress an inflated type 1 (fixed Huffman codes) block.  We should
        either replace this with a custom decoder, or at least precompute the
@@ -505,5 +505,5 @@
 }
 
-function zip_inflate_dynamic(buff, off, size) {
+var zip_inflate_dynamic = function(buff, off, size) {
     // decompress an inflated type 2 (dynamic Huffman codes) block.
     var i;		// temporary variables
@@ -628,5 +628,5 @@
 }
 
-function zip_inflate_start() {
+var zip_inflate_start = function() {
     var i;
 
@@ -642,5 +642,5 @@
 }
 
-function zip_inflate_internal(buff, off, size) {
+var zip_inflate_internal = function(buff, off, size) {
     // decompress an inflated entry
     var n, i;
@@ -728,6 +728,5 @@
 }
 
-function zip_inflate(str) {
-    var out, buff;
+var zip_inflate = function(str) {
     var i, j;
 
@@ -736,6 +735,5 @@
     zip_inflate_pos = 0;
 
-    buff = new Array(1024);
-    // out = "";
+    var buff = new Array(1024);
     var aout = [];
     while((i = zip_inflate_internal(buff, 0, buff.length)) > 0) {
@@ -747,5 +745,4 @@
     }
     zip_inflate_data = null; // G.C.
-    // return out;
     return aout.join("");
 }
Index: lang/javascript/deflate/trunk/rawdeflate.js
===================================================================
--- lang/javascript/deflate/trunk/rawdeflate.js (revision 30671)
+++ lang/javascript/deflate/trunk/rawdeflate.js (revision 30674)
@@ -1644,5 +1644,4 @@
 
 function zip_deflate(str, level) {
-    var out, buff;
     var i, j;
 
@@ -1653,12 +1652,15 @@
     zip_deflate_start(level);
 
-    buff = new Array(1024);
-    out = "";
+    var buff = new Array(1024);
+    var aout = [];
     while((i = zip_deflate_internal(buff, 0, buff.length)) > 0) {
-	for(j = 0; j < i; j++)
-	    out += String.fromCharCode(buff[j]);
+	var cbuf = new Array(i);
+	for(j = 0; j < i; j++){
+	    cbuf[j] = String.fromCharCode(buff[j]);
+	}
+	aout[aout.length] = cbuf.join("");
     }
     zip_deflate_data = null; // G.C.
-    return out;
+    return aout.join("");
 }
 
