Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the global.process issue in TcpSocket.js while preserving debugging #89

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions TcpSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

'use strict';

global.process = require('process'); // needed to make stream-browserify happy
// if global.process does not have nextTick, redefine global.process.
if(!(global.process && global.process.nextTick)){
global.process = require('process'); // needed to make stream-browserify happy
}

var Buffer = global.Buffer = global.Buffer || require('buffer').Buffer;

var util = require('util');
Expand Down Expand Up @@ -69,7 +73,7 @@ TcpSocket.prototype._debug = function() {
if (__DEV__) {
var args = [].slice.call(arguments);
args.unshift('socket-' + this._id);
console.log.apply(console, args);
//console.log.apply(console, args);
}
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-tcp",
"version": "3.3.0",
"version": "3.3.1",
"description": "node's net API for react-native",
"main": "TcpSockets.js",
"scripts": {
Expand Down