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

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@coolaj86

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
Member

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

@tj tj commented on the diff Jan 17, 2012
lib/fs.js
@@ -1038,8 +1038,13 @@ var ReadStream = fs.ReadStream = function(path, options) {
if (this.encoding) this.setEncoding(this.encoding);
if (this.start !== undefined) {
@tj
tj Jan 17, 2012

should be able to kill this conditional now

@coolaj86
coolaj86 Feb 18, 2012

not quite. this.start is allowed to be undefined

@bnoordhuis
Member

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

@coolaj86 coolaj86 added a commit to coolaj86/node that referenced this pull request Feb 18, 2012
@coolaj86 coolaj86 [ISSUE #2554 #2567] throw if fs args for 'start' or 'end' are strings 79e9f6a
@coolaj86 coolaj86 closed this Feb 18, 2012
@isaacs isaacs added a commit to isaacs/node-v0.x-archive that referenced this pull request Mar 2, 2012
@isaacs isaacs 2012.03.02 Version 0.6.12 (stable)
* Upgrade V8 to 3.6.6.24

* dtrace ustack helper improvements (Dave Pacheco)

* API Documentation refactor (isaacs)

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

* #2554 #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 #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
48a2d34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment