Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

[ISSUE #2554] Throw if start type is not number #2567

Closed

Conversation

coolaj86
Copy link

fs.createReadStream allows strings to be passed as start and end, but then concatenates them rather than throwing an error or converting them.

see Issue #2554

@bnoordhuis
Copy link
Member

Thanks AJ. Can you add one or two tests and use the commit template from https://github.com/joyent/node/wiki/Contributing?

@@ -1038,8 +1038,13 @@ var ReadStream = fs.ReadStream = function(path, options) {
if (this.encoding) this.setEncoding(this.encoding);

if (this.start !== undefined) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be able to kill this conditional now

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not quite. this.start is allowed to be undefined

@bnoordhuis
Copy link
Member

@coolaj86: Are you going to update the PR? If not, can you close it?

coolaj86 pushed a commit to coolaj86/node that referenced this pull request Feb 18, 2012
@coolaj86 coolaj86 closed this Feb 18, 2012
isaacs added a commit to isaacs/node-v0.x-archive that referenced this pull request Mar 2, 2012
* Upgrade V8 to 3.6.6.24

* dtrace ustack helper improvements (Dave Pacheco)

* API Documentation refactor (isaacs)

* nodejs#2827 net: fix race write() before and after connect() (koichik)

* nodejs#2554 nodejs#2567 throw if fs args for 'start' or 'end' are strings (AJ ONeal)

* punycode: Update to v1.0.0 (Mathias Bynens)

* Make a fat binary for the OS X pkg (isaacs)

* Fix hang on accessing process.stdin (isaacs)

* repl: make tab completion work on non-objects (Nathan Rajlich)

* Fix fs.watch on OS X (Ben Noordhuis)

* Fix nodejs#2515 nested setTimeouts cause premature process exit (Ben Noordhuis)

* windows: fix time conversion in stat (Igor Zinkovsky)

* windows: fs: handle EOF in read (Brandon Philips)

* windows: avoid IOCP short-circuit on non-ifs lsps (Igor Zinkovsky)

* Upgrade npm to 1.1.4 (isaacs)
  - windows fixes
  - Bundle nested bundleDependencies properly
  - install: support --save with url install targets
  - shrinkwrap: behave properly with url-installed modules
  - support installing uncompressed tars or single file modules from urls etc.
  - don't run make clean on rebuild
  - support HTTPS-over-HTTP proxy tunneling
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants