diff options
author | Frankie <frankie.pangilinan@consensys.net> | 2016-06-22 06:04:00 +0800 |
---|---|---|
committer | Frankie <frankie.pangilinan@consensys.net> | 2016-06-22 06:04:00 +0800 |
commit | cf663f1104697440121d32cc6db2a8a1d5d54c5a (patch) | |
tree | 3ed4b8b9fe8c85f3b3a5bf68482c3fb9967f2de5 /app/scripts/lib/port-stream.js | |
parent | 265725c6edd62a7f46a9b9cf5a443cf01f0ff00c (diff) | |
parent | dc2ef967028723afe9fe1efd669754723e38a4f0 (diff) | |
download | tangerine-wallet-browser-cf663f1104697440121d32cc6db2a8a1d5d54c5a.tar tangerine-wallet-browser-cf663f1104697440121d32cc6db2a8a1d5d54c5a.tar.gz tangerine-wallet-browser-cf663f1104697440121d32cc6db2a8a1d5d54c5a.tar.bz2 tangerine-wallet-browser-cf663f1104697440121d32cc6db2a8a1d5d54c5a.tar.lz tangerine-wallet-browser-cf663f1104697440121d32cc6db2a8a1d5d54c5a.tar.xz tangerine-wallet-browser-cf663f1104697440121d32cc6db2a8a1d5d54c5a.tar.zst tangerine-wallet-browser-cf663f1104697440121d32cc6db2a8a1d5d54c5a.zip |
Fix conflict
Diffstat (limited to 'app/scripts/lib/port-stream.js')
-rw-r--r-- | app/scripts/lib/port-stream.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/app/scripts/lib/port-stream.js b/app/scripts/lib/port-stream.js index 2644741fc..1889e3c04 100644 --- a/app/scripts/lib/port-stream.js +++ b/app/scripts/lib/port-stream.js @@ -3,10 +3,9 @@ const inherits = require('util').inherits module.exports = PortDuplexStream - inherits(PortDuplexStream, Duplex) -function PortDuplexStream(port){ +function PortDuplexStream (port) { Duplex.call(this, { objectMode: true, }) @@ -17,7 +16,7 @@ function PortDuplexStream(port){ // private -PortDuplexStream.prototype._onMessage = function(msg){ +PortDuplexStream.prototype._onMessage = function (msg) { if (Buffer.isBuffer(msg)) { delete msg._isBuffer var data = new Buffer(msg) @@ -29,11 +28,11 @@ PortDuplexStream.prototype._onMessage = function(msg){ } } -PortDuplexStream.prototype._onDisconnect = function(){ +PortDuplexStream.prototype._onDisconnect = function () { try { // this.end() this.emit('close') - } catch(err){ + } catch (err) { this.emit('error', err) } } @@ -42,7 +41,7 @@ PortDuplexStream.prototype._onDisconnect = function(){ PortDuplexStream.prototype._read = noop -PortDuplexStream.prototype._write = function(msg, encoding, cb){ +PortDuplexStream.prototype._write = function (msg, encoding, cb) { try { if (Buffer.isBuffer(msg)) { var data = msg.toJSON() @@ -54,7 +53,7 @@ PortDuplexStream.prototype._write = function(msg, encoding, cb){ this._port.postMessage(msg) } cb() - } catch(err){ + } catch (err) { console.error(err) // this.emit('error', err) cb(new Error('PortDuplexStream - disconnected')) @@ -63,4 +62,4 @@ PortDuplexStream.prototype._write = function(msg, encoding, cb){ // util -function noop(){}
\ No newline at end of file +function noop () {} |