THRIFT-1431 Rename 'sys' module to 'util'
authorRoger Meier <roger@apache.org>
Wed, 23 Nov 2011 20:44:09 +0000 (20:44 +0000)
committerRoger Meier <roger@apache.org>
Wed, 23 Nov 2011 20:44:09 +0000 (20:44 +0000)
Patch: David Worms

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1205576 13f79535-47bb-0310-9956-ffa450edef68

.gitignore
lib/nodejs/lib/thrift/binary_parser.js
lib/nodejs/lib/thrift/connection.js
lib/nodejs/lib/thrift/protocol.js
lib/nodejs/lib/thrift/server.js
lib/nodejs/lib/thrift/thrift.js

index ccce2c3..26317c1 100644 (file)
 /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
index 2aeda46..273440b 100644 (file)
@@ -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 @@ 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));}
   }
 };
 
@@ -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));}
   }
 };
index b7f9b7a..cd31a50 100644 (file)
@@ -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 @@ var Connection = exports.Connection = function(stream, options) {
     }
   }));
 };
-sys.inherits(Connection, EventEmitter);
+util.inherits(Connection, EventEmitter);
 
 Connection.prototype.end = function() {
   this.connection.end();
@@ -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();
index f333bb9..1b6c345 100644 (file)
@@ -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 @@ 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;
index a73f23e..abdf579 100644 (file)
@@ -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,
index a079001..6c500a5 100644 (file)
@@ -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 @@ 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,
@@ -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
@@ -136,5 +136,5 @@ exports.objectLength = function(obj) {
 }
 
 exports.inherits = function(constructor, superConstructor) {
-  sys.inherits(constructor, superConstructor);
+  util.inherits(constructor, superConstructor);
 }