Permalink
Browse files

expected behaviour is to not mutate array

  • Loading branch information...
1 parent ab2aa23 commit 7a97028681c6a4fd2503f06476aaa526db0fa8d8 @dominictarr committed Mar 17, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 index.js
View
@@ -11,15 +11,16 @@ var Stream = require('stream')
module.exports =
function from (source) {
- if(Array.isArray(source))
+ if(Array.isArray(source)) {
+ source = source.slice()
return from (function (i) {
if(source.length)
this.emit('data', source.shift())
else
this.emit('end')
return true
})
-
+ }
var s = new Stream(), i = 0
s.ended = false
s.started = false

0 comments on commit 7a97028

Please sign in to comment.