[Pkg-javascript-commits] [node-jsonstream] 23/214: finally fixed the zero-length bug

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 1 12:58:34 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 0c2f550ebd3365a07a90b1332609fe6ebbdcddc9
Author: James Halliday <mail at substack.net>
Date:   Wed Feb 22 11:37:22 2012 -0800

    finally fixed the zero-length bug
---
 index.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index 1cee1af..4018e30 100644
--- a/index.js
+++ b/index.js
@@ -98,10 +98,10 @@ exports.stringify = function (op, sep, cl) {
     , ended = false
     , anyData = false
   stream.write = function (data) {
+    anyData = true
     var json = JSON.stringify(data)
     if(first) { first = false ; stream.emit('data', op + json)}
     else stream.emit('data', sep + json)
-    anyData = true
   }
   stream.end = function (data) {
     if(ended)
@@ -139,10 +139,10 @@ exports.stringifyObject = function (op, sep, cl) {
     , ended = false
     , anyData = false
   stream.write = function (data) {
+    anyData = true
     var json = JSON.stringify(data[0]) + ':' + JSON.stringify(data[1])
     if(first) { first = false ; stream.emit('data', op + json)}
     else stream.emit('data', sep + json)
-    anyData = true
   }
   stream.end = function (data) {
     if(ended) return

-- 
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