Skip to content
This repository

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

Closed
wants to merge 1 commit into from

2 participants

node-migrator-bot Farrin Reid
node-migrator-bot

Hello nodejitsu!

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 .

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

Farrin Reid

dup

Farrin Reid blakmatrix closed this June 25, 2012
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 19, 2012
Farrin Reid [fix] Changed require('sys') to require('util') for compatibility wit…
…h node v0.8
cb62e37
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 6 additions and 6 deletions. Show diff stats Hide diff stats

  1. 12  vendor/websocket.js
12  vendor/websocket.js
@@ -38,7 +38,7 @@ var http = require('http');
38 38
 var https = require('https');
39 39
 var net = require('net');
40 40
 var urllib = require('url');
41  
-var sys = require('sys');
  41
+var util = require('util');
42 42
 
43 43
 var FRAME_NO = 0;
44 44
 var FRAME_LO = 1;
@@ -52,7 +52,7 @@ var CLOSED = 3;
52 52
 
53 53
 var debugLevel = parseInt(process.env.NODE_DEBUG, 16);
54 54
 var debug = (debugLevel & 0x4) ?
55  
-    function() { sys.error.apply(this, arguments); } :
  55
+    function() { util.error.apply(this, arguments); } :
56 56
     function() { };
57 57
 
58 58
 // Generate a Sec-WebSocket-* value
@@ -246,7 +246,7 @@ var WebSocket = function(url, proto, opts) {
246 246
 
247 247
         // FRAME_LO
248 248
         function(buf, off) {
249  
-            debug('frame_lo(' + sys.inspect(buf) + ', ' + off + ')');
  249
+            debug('frame_lo(' + util.inspect(buf) + ', ' + off + ')');
250 250
 
251 251
             // Find the first instance of 0xff, our terminating byte
252 252
             for (var i = off; i < buf.length && buf[i] != 0xff; i++)
@@ -306,7 +306,7 @@ var WebSocket = function(url, proto, opts) {
306 306
 
307 307
         // FRAME_HI
308 308
         function(buf, off) {
309  
-            debug('frame_hi(' + sys.inspect(buf) + ', ' + off + ')');
  309
+            debug('frame_hi(' + util.inspect(buf) + ', ' + off + ')');
310 310
 
311 311
             if (buf[off] !== 0) {
312 312
                 throw new Error('High-byte framing not supported.');
@@ -323,7 +323,7 @@ var WebSocket = function(url, proto, opts) {
323 323
             return;
324 324
         }
325 325
 
326  
-        debug('dataListener(' + sys.inspect(buf) + ')');
  326
+        debug('dataListener(' + util.inspect(buf) + ')');
327 327
 
328 328
         var off = 0;
329 329
         var consumed = 0;
@@ -624,7 +624,7 @@ var WebSocket = function(url, proto, opts) {
624 624
         httpReq.end();
625 625
     })();
626 626
 };
627  
-sys.inherits(WebSocket, events.EventEmitter);
  627
+util.inherits(WebSocket, events.EventEmitter);
628 628
 exports.WebSocket = WebSocket;
629 629
 
630 630
 // Add some constants to the WebSocket object
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.