THRIFT-1431 Rename 'sys' module to 'util'
Patch: David Worms
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1205576 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/.gitignore b/.gitignore
index ccce2c3..26317c1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/lib/nodejs/lib/thrift/binary_parser.js b/lib/nodejs/lib/thrift/binary_parser.js
index 2aeda46..273440b 100644
--- a/lib/nodejs/lib/thrift/binary_parser.js
+++ b/lib/nodejs/lib/thrift/binary_parser.js
@@ -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 ){
@@ -248,10 +248,10 @@
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));}
}
};
@@ -263,12 +263,12 @@
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));}
}
};
diff --git a/lib/nodejs/lib/thrift/connection.js b/lib/nodejs/lib/thrift/connection.js
index b7f9b7a..cd31a50 100644
--- a/lib/nodejs/lib/thrift/connection.js
+++ b/lib/nodejs/lib/thrift/connection.js
@@ -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'),
@@ -92,7 +92,7 @@
}
}));
};
-sys.inherits(Connection, EventEmitter);
+util.inherits(Connection, EventEmitter);
Connection.prototype.end = function() {
this.connection.end();
@@ -208,7 +208,7 @@
};
-sys.inherits(StdIOConnection, EventEmitter);
+util.inherits(StdIOConnection, EventEmitter);
StdIOConnection.prototype.end = function() {
this.connection.end();
diff --git a/lib/nodejs/lib/thrift/protocol.js b/lib/nodejs/lib/thrift/protocol.js
index f333bb9..1b6c345 100644
--- a/lib/nodejs/lib/thrift/protocol.js
+++ b/lib/nodejs/lib/thrift/protocol.js
@@ -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;
@@ -34,7 +34,7 @@
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;
diff --git a/lib/nodejs/lib/thrift/server.js b/lib/nodejs/lib/thrift/server.js
index a73f23e..abdf579 100644
--- a/lib/nodejs/lib/thrift/server.js
+++ b/lib/nodejs/lib/thrift/server.js
@@ -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,
diff --git a/lib/nodejs/lib/thrift/thrift.js b/lib/nodejs/lib/thrift/thrift.js
index a079001..6c500a5 100644
--- a/lib/nodejs/lib/thrift/thrift.js
+++ b/lib/nodejs/lib/thrift/thrift.js
@@ -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,
@@ -49,7 +49,7 @@
Error.call(this, message);
this.name = 'TException';
}
-sys.inherits(TException, Error);
+util.inherits(TException, Error);
var TApplicationExceptionType = exports.TApplicationExceptionType = {
UNKNOWN: 0,
@@ -67,7 +67,7 @@
this.type = type || TApplicationExceptionType.UNKNOWN;
this.name = 'TApplicationException';
}
-sys.inherits(TApplicationException, TException);
+util.inherits(TApplicationException, TException);
TApplicationException.prototype.read = function(input) {
var ftype
@@ -136,5 +136,5 @@
}
exports.inherits = function(constructor, superConstructor) {
- sys.inherits(constructor, superConstructor);
+ util.inherits(constructor, superConstructor);
}