Skip to content
This repository

Hi! I fixed some calls to "sys" for you! #17

Merged
merged 1 commit into from almost 2 years ago

4 participants

node-migrator-bot Jan Keromnes Christian Amor Kvalheim Farrin Reid
node-migrator-bot

Hello christkv!

I am migrationBot, an open-source bot, and I'm here to help you migrate your codebase to node v0.8!

Did you know that the "sys" module throws an error if your program tries to require it in node v0.8? To help keep your code running, I automatically replaced var sys = require('sys') with var util = require('util').

If you'd like to know more about these changes in node.js, take a look at https://github.com/joyent/node/commit/1582cf#L1R51 and https://github.com/joyent/node/blob/1582cfebd6719b2d2373547994b3dca5c8c569c0/ChangeLog#L51 and http://blog.jit.su/introducing-blakmatrix-and-migratorbot .

As for myself, I was written by your friendly neighborhood node ninjas at Nodejitsu, and you can find them at #nodejitsu on irc.freenode.net or with http://webchat.jit.su .

Enjoy!

--migrationBot

Jan Keromnes
Collaborator

That's a good first step to undust this library! Thanks a lot for the effort. @christkv I hope you don't mind if I merge this.

Jan Keromnes jankeromnes merged commit 91f4c59 into from June 23, 2012
Jan Keromnes jankeromnes closed this June 23, 2012
Christian Amor Kvalheim
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jun 23, 2012
Farrin Reid [fix] Changed require('sys') to require('util') for compatibility wit…
…h node v0.8
0fc4c2f
This page is out of date. Refresh to see the latest.
10  benchmarks/benchmark.js
... ...
@@ -1,6 +1,6 @@
1 1
 
2 2
 var Repo = require('git/repo').Repo,
3  
-  sys = require('sys'),
  3
+  util = require('util'),
4 4
   fs = require('fs'),
5 5
   exec  = require('child_process').exec;
6 6
 
@@ -14,7 +14,7 @@ var create_tmp_directory = function(clone_path, callback) {
14 14
   // Copy the old directory to the new one
15 15
   var child = exec('cp -R ' + clone_path + ' ' + tmp_path, function (error, stdout, stderr) {
16 16
       if (error !== null) {
17  
-        sys.puts('exec error: ' + error);
  17
+        util.puts('exec error: ' + error);
18 18
         return callback(error, null);
19 19
       }
20 20
       return callback(null, tmp_path);
@@ -25,7 +25,7 @@ var destroy_directory = function(directory, callback) {
25 25
   // Copy the old directory to the new one
26 26
   var child = exec('rm -rf ' + directory, function (error, stdout, stderr) {
27 27
       if (error !== null) {
28  
-        sys.puts('exec error: ' + error);
  28
+        util.puts('exec error: ' + error);
29 29
         return callback(error, null);
30 30
       }
31 31
       return callback(null, null);    
@@ -125,7 +125,7 @@ var execute_process = function(type) {
125 125
         
126 126
         var end_time = new Date();
127 127
         var total_miliseconds = end_time.getTime() - start_time.getTime();
128  
-        sys.puts("[" + type + "]::executed in: " + (total_miliseconds/1000) + " seconds");        
  128
+        util.puts("[" + type + "]::executed in: " + (total_miliseconds/1000) + " seconds");        
129 129
         // Delete the directory
130 130
         destroy_directory(target_path, function(err, result) {});
131 131
       });      
@@ -144,7 +144,7 @@ if(process.argv.length > 2 && process.argv[2].match(/packobj|commits1|commits2|b
144 144
     execute_process(process.argv[2]);
145 145
   }  
146 146
 } else {
147  
-  sys.puts("Please provide the benchmark you wish to run in the form <node benchmarks [packobj|commits1|commits2|big_revlist|log|diff|commit_diff|heads|all]>")
  147
+  util.puts("Please provide the benchmark you wish to run in the form <node benchmarks [packobj|commits1|commits2|big_revlist|log|diff|commit_diff|heads|all]>")
148 148
 }
149 149
   
150 150
 
4  lib/diff/diff.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   SequenceCallbacks = require('./callbacks').SequenceCallbacks,
3 3
   ContextChange = require('./change').ContextChange,
4 4
   Change = require('./change').Change,
@@ -762,7 +762,7 @@ Difference.LCS.__normalize_patchset = function(patchset) {
762 762
         });
763 763
       }      
764 764
     } else {
765  
-      throw "Cannot normalize the hunk: " + sys.inspect(hunk);
  765
+      throw "Cannot normalize the hunk: " + util.inspect(hunk);
766 766
     }    
767 767
   }));
768 768
 }
2  lib/git/actor.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys');
  1
+var util = require('util');
2 2
 
3 3
 Actor = exports.Actor = function(name, email) {
4 4
   var _name = name, _email = email;  
14  lib/git/binary_parser.js
@@ -222,25 +222,25 @@ p.encode_utf8 = function(s) {
222 222
 };
223 223
 
224 224
 p.pprint = function(s) {
225  
-  var sys = require('sys');
  225
+  var util = require('util');
226 226
   
227 227
   for (var i=0; i<s.length; i++) {
228  
-    if (s.charCodeAt(i)<32) {sys.puts(s.charCodeAt(i)+' : ');}
229  
-    else {sys.puts(s.charCodeAt(i)+' : '+ s.charAt(i));}
  228
+    if (s.charCodeAt(i)<32) {util.puts(s.charCodeAt(i)+' : ');}
  229
+    else {util.puts(s.charCodeAt(i)+' : '+ s.charAt(i));}
230 230
   }
231 231
 };
232 232
 
233 233
 p.hprint = function(s) {
234  
-  var sys = require('sys');
  234
+  var util = require('util');
235 235
   
236 236
   for (var i=0; i<s.length; i++) {
237  
-    if (s.charCodeAt(i)<32) {sys.puts(s.charCodeAt(i)+' : ');}
238  
-    else {sys.puts(s.charCodeAt(i).toString(16)+' : '+ s.charAt(i));}
  237
+    if (s.charCodeAt(i)<32) {util.puts(s.charCodeAt(i)+' : ');}
  238
+    else {util.puts(s.charCodeAt(i).toString(16)+' : '+ s.charAt(i));}
239 239
   }
240 240
 };
241 241
 
242 242
 p.hex = function(s) {
243  
-  var sys = require('sys');
  243
+  var util = require('util');
244 244
   var string = ''
245 245
   
246 246
   for (var i=0; i<s.length; i++) {
2  lib/git/commit.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   Actor = require('./actor').Actor,
3 3
   Diff = require('./diff').Diff;
4 4
   Tree = require('./tree').Tree;
2  lib/git/file_index.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   fs = require('fs');
3 3
 
4 4
 var FileIndex = exports.FileIndex = function(repo_path, callback) {
4  lib/git/file_window.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   fs = require('fs'),
3 3
   Buffer = require('buffer').Buffer;
4 4
 
@@ -32,7 +32,7 @@ FileWindow.prototype.index = function(idx) {
32 32
     offset = idx[0];
33 33
     len = idx[1]
34 34
   } else {
35  
-    throw "invalid index param: " + sys.inspect(idx);
  35
+    throw "invalid index param: " + util.inspect(idx);
36 36
   }
37 37
   
38 38
   // Seek position equivalent using a position in the read
2  lib/git/git.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
     fs = require('fs'),
3 3
     GitFileOperations = require('./git_file_operations').GitFileOperations,
4 4
     exec = require('child_process').exec,
4  lib/git/git_file_operations.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   fs = require('fs'),
3 3
   exec  = require('child_process').exec;
4 4
 
@@ -117,7 +117,7 @@ GitFileOperations.fs_rmdir_r = function(dir, callback) {
117 117
   // Copy the old directory to the new one
118 118
   var child = exec('rm -rf ' + dir, function (error, stdout, stderr) {
119 119
       if (error !== null) {
120  
-        sys.puts('exec error: ' + error);
  120
+        util.puts('exec error: ' + error);
121 121
         return callback(error, null);
122 122
       }
123 123
       return callback(null, null);    
2  lib/git/git_index.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   Tree = require('./tree').Tree,
3 3
   Config = require('./config').Config;
4 4
 
2  lib/git/head.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   Commit = require('./commit').Commit;
3 3
 
4 4
 var Head = exports.Head = function(name, commit) {
2  lib/git/internal/git_blob.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys');
  1
+var util = require('util');
2 2
 
3 3
 var GitBlob = exports.GitBlob = function(content, repository) {
4 4
   var _content = content, _repository = repository;
4  lib/git/internal/git_commit.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'), 
  1
+var util = require('util'), 
2 2
   UserInfo = require('../user_info').UserInfo;
3 3
 
4 4
 var GitCommit = exports.GitCommit = function(tree, parent, author, committer, message, headers, repository) {
@@ -51,7 +51,7 @@ GitCommit.from_raw = function(raw_object, repository) {
51 51
       committer = new UserInfo(value);
52 52
     } else {
53 53
       // Unknow header
54  
-      sys.puts("unknow header '" + key + "' in commit " + raw_object.sha_hex())
  54
+      util.puts("unknow header '" + key + "' in commit " + raw_object.sha_hex())
55 55
     }
56 56
   })
57 57
   
4  lib/git/internal/git_tag.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   UserInfo = require('../user_info').UserInfo;
3 3
 
4 4
 var GitTag = exports.GitTag = function(object, type, tag, tagger, message, repository) {
@@ -48,7 +48,7 @@ GitTag.from_raw = function(raw_object, repository) {
48 48
     } else if(key == 'tagger') {
49 49
       tagger = new UserInfo(value);
50 50
     } else {
51  
-      sys.puts("unknown header '" + key);
  51
+      util.puts("unknown header '" + key);
52 52
     }
53 53
   });
54 54
   
2  lib/git/internal/git_tree.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   BinaryParser = require('../binary_parser').BinaryParser,
3 3
   DirectoryEntry = require('../internal/directory_entry').DirectoryEntry;
4 4
 
2  lib/git/loose_storage.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   fs = require('fs'),
3 3
   BinaryParser = require('./binary_parser').BinaryParser,
4 4
   Zlib = require('../zlib/zlib').Zlib,
2  lib/git/mime/mime_types.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys');
  1
+var util = require('util');
2 2
 
3 3
 // All the mime types
4 4
 var mime_definition = "  # application/*\n\
2  lib/git/pack_storage.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   fs = require('fs'),
3 3
   Buffer = require('buffer').Buffer,
4 4
   BinaryParser = require('./binary_parser').BinaryParser,
2  lib/git/raw_object.js
... ...
@@ -1,5 +1,5 @@
1 1
 var crypto = require('crypto'),
2  
-  sys = require('sys'),
  2
+  util = require('util'),
3 3
   Buffer = require('buffer').Buffer,
4 4
   BinaryParser = require('./binary_parser').BinaryParser;
5 5
 
2  lib/git/repo.js
@@ -2,7 +2,7 @@ var Head = require('./head').Head,
2 2
   Git = require('./git').Git,
3 3
   Commit = require('./commit').Commit,
4 4
   fs = require('fs'),
5  
-  sys = require('sys'),
  5
+  util = require('util'),
6 6
   Tree = require('./tree').Tree,
7 7
   Blob = require('./blob').Blob,
8 8
   Head = require('./head').Head,
2  lib/git/repository.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   GitObject = require('./git_object').GitObject,
3 3
   fs = require('fs'),
4 4
   LooseStorage = require('./loose_storage').LooseStorage,
2  lib/git/status.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   GitFileOperations = require('./git_file_operations').GitFileOperations,
3 3
   StatusFile = require('./status_file').StatusFile;
4 4
 
2  lib/git/status_file.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys');
  1
+var util = require('util');
2 2
 
3 3
 var StatusFile = exports.StatusFile = function(repo , hash) {
4 4
   var _repo = repo;
2  lib/git/sub_module.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys');
  1
+var util = require('util');
2 2
 
3 3
 var Submodule = exports.Submodule = function(repo, id, mode, name) {
4 4
   var _repo = repo, _id = id, _mode = mode, _name = name;
2  lib/git/tree.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   Submodule = require('./sub_module').Submodule,
3 3
   Blob = require('./blob').Blob;
4 4
 
2  lib/git/user_info.js
... ...
@@ -1,4 +1,4 @@
1  
-var sys = require('sys'),
  1
+var util = require('util'),
2 2
   StringUtil = require('../sprintf/sprintf').StringUtil;
3 3
 
4 4
 var UserInfo = exports.UserInfo = function(string) {
96  lib/zlib/zlib.js
@@ -37,7 +37,7 @@
37 37
   * @see <a href="http://www.cs.tut.fi/~albert/Dev/gunzip/gunzip.c">http://www.cs.tut.fi/~albert/Dev/gunzip/gunzip.c</a>
38 38
   * @see <a href="http://www.cs.tut.fi/~albert">http://www.cs.tut.fi/~albert</a>
39 39
   */
40  
-var sys = require('sys');
  40
+var util = require('util');
41 41
 var Zlib = exports.Zlib = {};
42 42
       
43 43
 /**
@@ -136,7 +136,7 @@ Zlib.Unzip = function (barray){
136 136
         if (bytepos<bA.length){
137 137
             //if (debug)
138 138
             //    document.write(bytepos+": "+bA[bytepos]+"<br>");
139  
-            // sys.debug(bA[bytepos++].toString(16))
  139
+            // util.debug(bA[bytepos++].toString(16))
140 140
             // return String.fromCharCode(bA[bytepos++]);
141 141
             return bA[bytepos++];
142 142
         } else
@@ -227,7 +227,7 @@ Zlib.Unzip = function (barray){
227 227
         var curplace = Places[treepos];
228 228
         var tmp;
229 229
         if (debug)
230  
-          sys.debug("len: " + len + " treepos: " + treepos)
  230
+          util.debug("len: " + len + " treepos: " + treepos)
231 231
         if(len==17) { //war 17
232 232
             return -1;
233 233
         }
@@ -236,16 +236,16 @@ Zlib.Unzip = function (barray){
236 236
     	
237 237
         tmp = IsPat();
238 238
         if (debug)
239  
-          sys.debug("IsPat " + tmp)
  239
+          util.debug("IsPat " + tmp)
240 240
         if(tmp >= 0) {
241 241
             curplace.b0 = tmp;    /* leaf cell for 0-bit */
242 242
             if (debug)
243  
-              sys.debug("b0 " + curplace.b0)
  243
+              util.debug("b0 " + curplace.b0)
244 244
         } else {
245 245
         /* Not a Leaf cell */
246 246
         curplace.b0 = 0x8000;
247 247
         if (debug)
248  
-          sys.debug("b0 " + curplace.b0)
  248
+          util.debug("b0 " + curplace.b0)
249 249
         if(Rec())
250 250
             return -1;
251 251
         }
@@ -253,13 +253,13 @@ Zlib.Unzip = function (barray){
253 253
         if(tmp >= 0) {
254 254
             curplace.b1 = tmp;    /* leaf cell for 1-bit */
255 255
             if (debug)
256  
-              sys.debug("b1 " + curplace.b1);
  256
+              util.debug("b1 " + curplace.b1);
257 257
             curplace.jump = null;    /* Just for the display routine */
258 258
         } else {
259 259
             /* Not a Leaf cell */
260 260
             curplace.b1 = 0x8000;
261 261
             if (debug)
262  
-              sys.debug("b1 " + curplace.b1);
  262
+              util.debug("b1 " + curplace.b1);
263 263
             curplace.jump = Places[treepos];
264 264
             curplace.jumppos = treepos;
265 265
             if(Rec())
@@ -274,7 +274,7 @@ Zlib.Unzip = function (barray){
274 274
         /* Create the Huffman decode tree/table */
275 275
         //document.write("<br>createtree<br>");
276 276
         if (debug)
277  
-          sys.debug("currentTree " + currentTree + " numval " + numval + " lengths " + lengths + " show " + show);
  277
+          util.debug("currentTree " + currentTree + " numval " + numval + " lengths " + lengths + " show " + show);
278 278
         Places = currentTree;
279 279
         treepos=0;
280 280
         flens = lengths;
@@ -285,14 +285,14 @@ Zlib.Unzip = function (barray){
285 285
         if(Rec()) {
286 286
             //fprintf(stderr, "invalid huffman tree\n");
287 287
             if (debug)
288  
-              sys.debug("invalid huffman tree");
  288
+              util.debug("invalid huffman tree");
289 289
             return -1;
290 290
         }
291 291
         if (debug){
292  
-          sys.debug("Tree: " + Places.length);
  292
+          util.debug("Tree: " + Places.length);
293 293
         	for (var a=0;a<32;a++){
294  
-        	  sys.debug("Places[" + a + "].b0=" + Places[a].b0);
295  
-        	  sys.debug("Places[" + a + "].b1=" + Places[a].b1);
  294
+        	  util.debug("Places[" + a + "].b0=" + Places[a].b0);
  295
+        	  util.debug("Places[" + a + "].b1=" + Places[a].b1);
296 296
         	}
297 297
         }
298 298
     
@@ -324,11 +324,11 @@ Zlib.Unzip = function (barray){
324 324
         while(1) {
325 325
             b=readBit();
326 326
             if (debug)
327  
-              sys.debug("b=" + b);
  327
+              util.debug("b=" + b);
328 328
             if(b) {
329 329
                 if(!(X.b1 & 0x8000)){
330 330
                 	if (debug)
331  
-                	  sys.debug("ret1");
  331
+                	  util.debug("ret1");
332 332
                     return X.b1;    /* If leaf node, return data */
333 333
                 }
334 334
                 X = X.jump;
@@ -343,7 +343,7 @@ Zlib.Unzip = function (barray){
343 343
             } else {
344 344
                 if(!(X.b0 & 0x8000)){
345 345
                 	if (debug)
346  
-                	  sys.debug("ret2");
  346
+                	  util.debug("ret2");
347 347
                     return X.b0;    /* If leaf node, return data */
348 348
                 }
349 349
                 //X++; //??????????????????
@@ -352,7 +352,7 @@ Zlib.Unzip = function (barray){
352 352
             }
353 353
         }
354 354
         if (debug)
355  
-          sys.debug("ret3");
  355
+          util.debug("ret3");
356 356
         return -1;
357 357
     };
358 358
     
@@ -371,23 +371,23 @@ Zlib.Unzip = function (barray){
371 371
         switch(type) {
372 372
             case 0:
373 373
             	if (debug)
374  
-            	    sys.debug("Stored");
  374
+            	    util.debug("Stored");
375 375
                 break;
376 376
             case 1:
377 377
             	if (debug)
378  
-                  sys.debug("Fixed Huffman codes");
  378
+                  util.debug("Fixed Huffman codes");
379 379
                 break;
380 380
             case 2:
381 381
             	if (debug)
382  
-            	    sys.debug("Dynamic Huffman codes");
  382
+            	    util.debug("Dynamic Huffman codes");
383 383
                 break;
384 384
             case 3:
385 385
             	if (debug)
386  
-                  sys.debug("Reserved block type!!");
  386
+                  util.debug("Reserved block type!!");
387 387
                 break;
388 388
             default:
389 389
             	if (debug)
390  
-                  sys.debug("Unexpected value " + type);
  390
+                  util.debug("Unexpected value " + type);
391 391
                 break;
392 392
         }
393 393
         
@@ -403,7 +403,7 @@ Zlib.Unzip = function (barray){
403 403
             cSum |= (readByte()<<8);
404 404
 
405 405
             if(((blockLen ^ ~cSum) & 0xffff)) {
406  
-              sys.debug("BlockLen checksum mismatch");
  406
+              util.debug("BlockLen checksum mismatch");
407 407
             }
408 408
             while(blockLen--) {
409 409
                 c = readByte();
@@ -508,9 +508,9 @@ Zlib.Unzip = function (barray){
508 508
                 return 1;
509 509
             }
510 510
             if (debug){
511  
-              sys.debug("distanceTree");
  511
+              util.debug("distanceTree");
512 512
             	for(var a=0;a<distanceTree.length;a++){
513  
-                  sys.debug("" + distanceTree[a].b0 + " " + distanceTree[a].b1 + " " + distanceTree[a].jump + " " + distanceTree[a].jumppos);
  513
+                  util.debug("" + distanceTree[a].b0 + " " + distanceTree[a].b1 + " " + distanceTree[a].jump + " " + distanceTree[a].jumppos);
514 514
                 	/*if (distanceTree[a].jumppos!=-1)
515 515
                     	document.write(" "+distanceTree[a].jump.b0+" "+distanceTree[a].jump.b1);
516 516
                 	*/
@@ -523,12 +523,12 @@ Zlib.Unzip = function (barray){
523 523
             i = 0;
524 524
             var z=-1;
525 525
             if (debug)
526  
-              sys.debug("n=" + n + " bits: " + bits);
  526
+              util.debug("n=" + n + " bits: " + bits);
527 527
             while(i < n) {
528 528
                 z++;
529 529
                 j = DecodeValue(distanceTree);
530 530
                 if (debug)
531  
-                  sys.debug("" + z + " i:" + i + " decode: " + j + "    bits" + bits);
  531
+                  util.debug("" + z + " i:" + i + " decode: " + j + "    bits" + bits);
532 532
                 if(j<16) {    // length of code in bits (0..15)
533 533
                        ll[i++] = j;
534 534
                 } else if(j==16) {    // repeat last length 3 to 6 times 
@@ -583,7 +583,7 @@ Zlib.Unzip = function (barray){
583 583
                 return 1;
584 584
             }
585 585
             if (debug)
586  
-              sys.debug("literalTree");
  586
+              util.debug("literalTree");
587 587
             while(1) {
588 588
                 j = DecodeValue(literalTree);
589 589
                 if(j >= 256) {        // In C64: if carry set
@@ -636,7 +636,7 @@ Zlib.Unzip.prototype.unzipFile = function(name) {
636 636
 Zlib.Unzip.prototype.unzip = function() {
637 637
 	//convertToByteArray(input);
638 638
 	if (debug)
639  
-	  sys.debug(bA);
  639
+	  util.debug(bA);
640 640
 	/*for (i=0;i<bA.length*8;i++){
641 641
 		document.write(readBit());
642 642
 		if ((i+1)%8==0)
@@ -660,7 +660,7 @@ Zlib.Unzip.prototype.unzip = function() {
660 660
     
661 661
  function nextFile(){
662 662
  	if (debug)
663  
- 	  sys.debug("NEXTFILE");
  663
+ 	  util.debug("NEXTFILE");
664 664
  	outputArr = [];
665 665
  	var tmp = [];
666 666
  	modeZIP = false;
@@ -668,24 +668,24 @@ Zlib.Unzip.prototype.unzip = function() {
668 668
 	tmp[1] = readByte();
669 669
 	
670 670
 	if (debug)
671  
-	  sys.debug("type: " + tmp[0] + " " + tmp[1]);
  671
+	  util.debug("type: " + tmp[0] + " " + tmp[1]);
672 672
 	if (tmp[0] == parseInt("78",16) && (tmp[1] == parseInt("156",10) || tmp[1] == parseInt("1", 10))){ //GZIP
673 673
 		if (debug)
674  
-		  sys.debug("GEONExT-GZIP");
  674
+		  util.debug("GEONExT-GZIP");
675 675
 		DeflateLoop();
676 676
 		if (debug)
677  
-	    sys.debug(outputArr.join(''));
  677
+	    util.debug(outputArr.join(''));
678 678
     // unzipped[files] = new Array(2);
679 679
     	unzipped[files] = outputArr.join('');
680 680
     	files++;
681 681
 	}
682 682
 	if (tmp[0] == parseInt("1f",16) && tmp[1] == parseInt("8b",16)){ //GZIP
683 683
 		if (debug)
684  
-      sys.debug("GZIP");
  684
+      util.debug("GZIP");
685 685
 		//DeflateLoop();
686 686
 		skipdir();
687 687
 		if (debug)
688  
-      sys.debug(outputArr.join(''));
  688
+      util.debug(outputArr.join(''));
689 689
 		unzipped[files] = new Array(2);
690 690
     	unzipped[files][0] = outputArr.join('');
691 691
     	unzipped[files][1] = "file";
@@ -700,17 +700,17 @@ Zlib.Unzip.prototype.unzip = function() {
700 700
 			tmp[0] = readByte();
701 701
 			tmp[1] = readByte();
702 702
 			if (debug)
703  
-        sys.debug("ZIP-Version: "+tmp[1]+" "+tmp[0]/10+"."+tmp[0]%10);
  703
+        util.debug("ZIP-Version: "+tmp[1]+" "+tmp[0]/10+"."+tmp[0]%10);
704 704
 			
705 705
 			gpflags = readByte();
706 706
 			gpflags |= (readByte()<<8);
707 707
 			if (debug)
708  
-        sys.debug("gpflags: "+gpflags);
  708
+        util.debug("gpflags: "+gpflags);
709 709
 			
710 710
 			var method = readByte();
711 711
 			method |= (readByte()<<8);
712 712
 			if (debug)
713  
-        sys.debug("method: "+method);
  713
+        util.debug("method: "+method);
714 714
 			
715 715
 			readByte();
716 716
 			readByte();
@@ -733,7 +733,7 @@ Zlib.Unzip.prototype.unzip = function() {
733 733
 			size |= (readByte()<<24);
734 734
 			
735 735
 			if (debug)
736  
-			  sys.debug("local CRC: "+crc+"\nlocal Size: "+size+"\nlocal CompSize: "+compSize);
  736
+			  util.debug("local CRC: "+crc+"\nlocal Size: "+size+"\nlocal CompSize: "+compSize);
737 737
 			
738 738
 			var filelen = readByte();
739 739
 			filelen |= (readByte()<<8);
@@ -742,7 +742,7 @@ Zlib.Unzip.prototype.unzip = function() {
742 742
 			extralen |= (readByte()<<8);
743 743
 			
744 744
 			if (debug)
745  
-			  sys.debug("filelen "+filelen);
  745
+			  util.debug("filelen "+filelen);
746 746
 			i = 0;
747 747
 			nameBuf = [];
748 748
 			while (filelen--){ 
@@ -753,7 +753,7 @@ Zlib.Unzip.prototype.unzip = function() {
753 753
 					nameBuf[i++] = String.fromCharCode(c);
754 754
 			}
755 755
 			if (debug)
756  
-			  sys.debug("nameBuf: "+nameBuf);
  756
+			  util.debug("nameBuf: "+nameBuf);
757 757
 			
758 758
 			//nameBuf[i] = "\0";
759 759
 			if (!fileout)
@@ -771,12 +771,12 @@ Zlib.Unzip.prototype.unzip = function() {
771 771
 			if (size = 0 && fileOut.charAt(fileout.length-1)=="/"){
772 772
 				//skipdir
773 773
 				if (debug)
774  
-				  sys.debug("skipdir");
  774
+				  util.debug("skipdir");
775 775
 			}
776 776
 			if (method == 8){
777 777
 				DeflateLoop();
778 778
 				if (debug)
779  
-				  sys.debug(outputArr.join(''));
  779
+				  util.debug(outputArr.join(''));
780 780
 				unzipped[files] = new Array(2);
781 781
 				unzipped[files][0] = outputArr.join('');
782 782
     			unzipped[files][1] = nameBuf.join('');
@@ -823,7 +823,7 @@ function skipdir(){
823 823
 		size |= (readByte()<<24);
824 824
 		
825 825
 		if (debug)
826  
-		  sys.debug("CRC:");
  826
+		  util.debug("CRC:");
827 827
 	}
828 828
 
829 829
 	if (modeZIP)
@@ -832,14 +832,14 @@ function skipdir(){
832 832
 	tmp[0] = readByte();
833 833
 	if (tmp[0] != 8) {
834 834
 		if (debug)
835  
-		  sys.debug("Unknown compression method!");
  835
+		  util.debug("Unknown compression method!");
836 836
         return 0;	
837 837
 	}
838 838
 	
839 839
 	gpflags = readByte();
840 840
 	if (debug){
841 841
 		if ((gpflags & ~(parseInt("1f",16))))
842  
-		  sys.debug("Unknown flags set!");
  842
+		  util.debug("Unknown flags set!");
843 843
 	}
844 844
 	
845 845
 	readByte();
@@ -855,7 +855,7 @@ function skipdir(){
855 855
 		tmp[2] = readByte();
856 856
 		len = tmp[0] + 256*tmp[1];
857 857
 		if (debug)
858  
-		  sys.debug("Extra field size: "+len);
  858
+		  util.debug("Extra field size: "+len);
859 859
 		for (i=0;i<len;i++)
860 860
 			readByte();
861 861
 	}
@@ -871,7 +871,7 @@ function skipdir(){
871 871
 		}
872 872
 		//nameBuf[i] = "\0";
873 873
 		if (debug)
874  
-		  sys.debug("original file name: "+nameBuf);
  874
+		  util.debug("original file name: "+nameBuf);
875 875
 	}
876 876
 		
877 877
 	if ((gpflags & 16)){
2  test/diff/test_diff.js
... ...
@@ -1,6 +1,6 @@
1 1
 
2 2
 TestSuite = require('async_testing').TestSuite,
3  
-  sys = require('sys'),
  3
+  util = require('util'),
4 4
   Difference = require('diff/diff').Difference,
5 5
   ContextChange = require('diff/change').ContextChange,
6 6
   Change = require('diff/change').Change;
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.