Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Move props.path check below class init #55

Merged
merged 1 commit into from
Mar 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ function Reader (props, currentStat) {
props = { path: props }
}

if (!props.path) {
self.error('Must provide a path', null, true)
}

// polymorphism.
// call fstream.Reader(dir) to get a DirReader object, etc.
// Note that, unlike in the Writer case, ProxyReader is going
Expand Down Expand Up @@ -85,6 +81,10 @@ function Reader (props, currentStat) {

Abstract.call(self)

if (!props.path) {
self.error('Must provide a path', null, true)
}

self.readable = true
self.writable = false

Expand Down
4 changes: 2 additions & 2 deletions lib/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ function Writer (props, current) {
props = { path: props }
}

if (!props.path) self.error('Must provide a path', null, true)

// polymorphism.
// call fstream.Writer(dir) to get a DirWriter object, etc.
var type = getType(props)
Expand Down Expand Up @@ -61,6 +59,8 @@ function Writer (props, current) {

Abstract.call(self)

if (!props.path) self.error('Must provide a path', null, true)

// props is what we want to set.
// set some convenience properties as well.
self.type = props.type
Expand Down