This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
confusing error for fs.createReadStream(path, { start: "90", end: "99"})
#2554
Labels
Comments
coolaj86
pushed a commit
to coolaj86/node
that referenced
this issue
Jan 17, 2012
I'll take a patch but don't be accommodating, just throw a TypeError when start or end isn't a number. |
coolaj86
pushed a commit
to coolaj86/node
that referenced
this issue
Feb 18, 2012
This was referenced Feb 18, 2012
isaacs
pushed a commit
that referenced
this issue
Feb 27, 2012
isaacs
pushed a commit
that referenced
this issue
Feb 27, 2012
isaacs
added a commit
to isaacs/node-v0.x-archive
that referenced
this issue
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.
This concerns the case that a string is passed in to createReadStream
start
orend
, instead of a number.There are several places in
fs.js
wherethis.pos += {{whatever}}
will result in string concatenation and throw a confusing error:I propose that
this.pos = parseInt(this.start, 10)
be used (in the if block around line 1040 in fs.js) instead ofthis.pos = this.start
.I'll be happy to submit the pull request if you like.
In context:
The text was updated successfully, but these errors were encountered: