[Pkg-javascript-commits] [node-jsonstream] 166/214: Fix jsonparse library (using my repo, waiting merge to jsonparse master project)

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 1 12:58:55 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 65b3a1d9647bca1f230a72d60a73280b75a34c9b
Author: Guillaume Chauvet <g.chauvet at bimedia.com.fr>
Date:   Fri Aug 28 17:19:03 2015 +0200

    Fix jsonparse library (using my repo, waiting merge to jsonparse master project)
---
 index.js       | 6 +-----
 package.json   | 4 ++--
 test/issues.js | 6 +++---
 3 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/index.js b/index.js
index 7fc4ac2..7d0b5ca 100755
--- a/index.js
+++ b/index.js
@@ -18,11 +18,7 @@ exports.parse = function (path, map) {
   var stream = through(function (chunk) {
     if('string' === typeof chunk)
       chunk = new Buffer(chunk)
-    try {
       parser.write(chunk);
-    } catch(e) {
-      stream.emit('error', e);
-    }
   },
   function (data) {
     if(data)
@@ -109,7 +105,7 @@ exports.parse = function (path, map) {
   parser.onError = function (err) {
     if(err.message.indexOf("at position") > -1)
       err.message = "Invalid JSON (" + err.message + ")";
-    stream.emit('error', err)
+      stream.emit('error', err)
   }
   
   return stream
diff --git a/package.json b/package.json
index 4411fcb..8b3dfb4 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "JSONStream",
-  "version": "1.0.4",
+  "version": "1.0.5",
   "description": "rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)",
   "homepage": "http://github.com/dominictarr/JSONStream",
   "repository": {
@@ -17,7 +17,7 @@
     "parsing"
   ],
   "dependencies": {
-    "jsonparse": "~1.0.0",
+    "jsonparse": "git://github.com/gchauvet/jsonparse.git",
     "through": ">=2.2.7 <3"
   },
   "devDependencies": {
diff --git a/test/issues.js b/test/issues.js
index d852216..e554be6 100644
--- a/test/issues.js
+++ b/test/issues.js
@@ -2,15 +2,15 @@ var JSONStream = require('../');
 var test = require('tape')
 
 test('#66', function (t) {
-  var passed = false;
+   var error = 0;
    var stream = JSONStream
     .parse()
     .on('error', function (err) {
         t.ok(err);
-        passed = true;
+        error++;
     })
     .on('end', function () {
-        t.ok(passed);
+        t.ok(error > 0);
         t.end();
     });
 

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