Skip to content

Commit

Permalink
THRIFT-1431 Rename 'sys' module to 'util'
Browse files Browse the repository at this point in the history
Patch: David Worms

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1205576 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
bufferoverflow committed Nov 23, 2011
1 parent ac10256 commit 289cbb2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
/lib/js/test/gen-*
/lib/js/test/Makefile
/lib/js/test/Makefile.in
/lib/nodejs/examples/gen-*
/lib/perl/MANIFEST
/lib/perl/Makefile
/lib/perl/Makefile.in
Expand Down
12 changes: 6 additions & 6 deletions lib/nodejs/lib/thrift/binary_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
var sys = require('sys');
var util = require('util');
var chr = String.fromCharCode;

var p = exports.BinaryParser = function( bigEndian, allowExceptions ){
Expand Down Expand Up @@ -248,10 +248,10 @@ p.hprint = function(s) {
for (var i=0; i<s.length; i++) {
if (s.charCodeAt(i)<32) {
var number = s.charCodeAt(i) <= 15 ? "0" + s.charCodeAt(i).toString(16) : s.charCodeAt(i).toString(16);
sys.debug(number+' : ');}
util.debug(number+' : ');}
else {
var number = s.charCodeAt(i) <= 15 ? "0" + s.charCodeAt(i).toString(16) : s.charCodeAt(i).toString(16);
sys.debug(number+' : '+ s.charAt(i));}
util.debug(number+' : '+ s.charAt(i));}
}
};

Expand All @@ -263,12 +263,12 @@ p.to_byte_array = function(s) {
else {array.push(s.charCodeAt(i))}
}

sys.puts(array);
util.puts(array);
}

p.pprint = function(s) {
for (var i=0; i<s.length; i++) {
if (s.charCodeAt(i)<32) {sys.puts(s.charCodeAt(i)+' : ');}
else {sys.puts(s.charCodeAt(i)+' : '+ s.charAt(i));}
if (s.charCodeAt(i)<32) {util.puts(s.charCodeAt(i)+' : ');}
else {util.puts(s.charCodeAt(i)+' : '+ s.charAt(i));}
}
};
6 changes: 3 additions & 3 deletions lib/nodejs/lib/thrift/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
var sys = require('sys'),
var util = require('util'),
EventEmitter = require("events").EventEmitter,
net = require('net'),
ttransport = require('./transport'),
Expand Down Expand Up @@ -92,7 +92,7 @@ var Connection = exports.Connection = function(stream, options) {
}
}));
};
sys.inherits(Connection, EventEmitter);
util.inherits(Connection, EventEmitter);

Connection.prototype.end = function() {
this.connection.end();
Expand Down Expand Up @@ -208,7 +208,7 @@ var StdIOConnection = exports.StdIOConnection = function(command, options) {

};

sys.inherits(StdIOConnection, EventEmitter);
util.inherits(StdIOConnection, EventEmitter);

StdIOConnection.prototype.end = function() {
this.connection.end();
Expand Down
4 changes: 2 additions & 2 deletions lib/nodejs/lib/thrift/protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
var sys = require('sys'),
var util = require('util'),
Thrift = require('./thrift'),
Type = Thrift.Type;

Expand All @@ -34,7 +34,7 @@ var TProtocolException = function(type, message) {
this.name = 'TProtocolException';
this.type = type;
}
sys.inherits(TProtocolException, Error);
util.inherits(TProtocolException, Error);

var TBinaryProtocol = exports.TBinaryProtocol = function(trans, strictRead, strictWrite) {
this.trans = trans;
Expand Down
3 changes: 1 addition & 2 deletions lib/nodejs/lib/thrift/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
var sys = require('sys'),
net = require('net');
var net = require('net');

var ttransport = require('./transport');
var BinaryParser = require('./binary_parser').BinaryParser,
Expand Down
8 changes: 4 additions & 4 deletions lib/nodejs/lib/thrift/thrift.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
var sys = require('sys');
var util = require('util');

var Type = exports.Type = {
STOP: 0,
Expand Down Expand Up @@ -49,7 +49,7 @@ var TException = exports.TException = function(message) {
Error.call(this, message);
this.name = 'TException';
}
sys.inherits(TException, Error);
util.inherits(TException, Error);

var TApplicationExceptionType = exports.TApplicationExceptionType = {
UNKNOWN: 0,
Expand All @@ -67,7 +67,7 @@ var TApplicationException = exports.TApplicationException = function(type, messa
this.type = type || TApplicationExceptionType.UNKNOWN;
this.name = 'TApplicationException';
}
sys.inherits(TApplicationException, TException);
util.inherits(TApplicationException, TException);

TApplicationException.prototype.read = function(input) {
var ftype
Expand Down Expand Up @@ -136,5 +136,5 @@ exports.objectLength = function(obj) {
}

exports.inherits = function(constructor, superConstructor) {
sys.inherits(constructor, superConstructor);
util.inherits(constructor, superConstructor);
}

0 comments on commit 289cbb2

Please sign in to comment.