Skip to content
This repository
Browse code

[fix] Changed require('sys') to require('util') for compatibility wit…

…h node v0.8
  • Loading branch information...
commit cb62e37918625504cbcbec073c1a56b473287480 1 parent ccd8f84
Farrin Reid blakmatrix authored

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

  1. +6 6 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

0 comments on commit cb62e37

Please sign in to comment.
Something went wrong with that request. Please try again.