[Pkg-javascript-commits] [node-jsonstream] 192/214: don't need stream.end() after emitting error

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 1 12:58:59 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-jsonstream.

commit 85a7936ecf6a4a456fa9195ff57c35f2cebef0e6
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date:   Thu Jun 30 13:22:16 2016 +1200

    don't need stream.end() after emitting error
---
 index.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index 1e0a4f9..9c8ac1e 100755
--- a/index.js
+++ b/index.js
@@ -158,8 +158,7 @@ exports.stringify = function (op, sep, cl, indent) {
     try {
       var json = JSON.stringify(data, null, indent)
     } catch (err) {
-      stream.emit('error', err)
-      return stream.end()
+      return stream.emit('error', err)
     }
     if(first) { first = false ; stream.queue(op + json)}
     else stream.queue(sep + json)
@@ -214,3 +213,4 @@ if(!module.parent && process.title !== 'browser') {
     .pipe(exports.stringify('[', ',\n', ']\n', 2))
     .pipe(process.stdout)
 }
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-jsonstream.git



More information about the Pkg-javascript-commits mailing list