[Pkg-javascript-commits] [node-stream-splicer] 54/71: fixes for get()

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:55:52 UTC 2017


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

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

commit 9ede3d282c4b31403976ffa338a4c3be736fc8aa
Author: James Halliday <mail at substack.net>
Date:   Sat Jun 14 20:24:10 2014 -0700

    fixes for get()
---
 index.js              | 7 +++----
 test/nested_middle.js | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/index.js b/index.js
index fc9ea1c..3dc9f7d 100644
--- a/index.js
+++ b/index.js
@@ -161,17 +161,16 @@ Pipeline.prototype.splice = function (start, removeLen) {
 Pipeline.prototype.get = function () {
     if (arguments.length === 0) return undefined;
     
-    var base = this._streams;
+    var base = this;
     for (var i = 0; i < arguments.length; i++) {
         var index = arguments[i];
         if (index < 0) {
-            base = base[base.length + index];
+            base = base._streams[base._streams.length + index];
         }
         else {
-            base = base[index];
+            base = base._streams[index];
         }
         if (!base) return undefined;
-        if (base._streams) base = base._streams;
     }
     return base;
 };
diff --git a/test/nested_middle.js b/test/nested_middle.js
index 05573a3..0988bda 100644
--- a/test/nested_middle.js
+++ b/test/nested_middle.js
@@ -5,7 +5,7 @@ var split = require('split');
 var concat = require('concat-stream');
 var test = require('tape');
 
-test('nested splicer', function (t) {
+test('nested middle splicer', function (t) {
     t.plan(1);
     
     var addNewLines = through(function (buf, enc, next) {

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



More information about the Pkg-javascript-commits mailing list