Skip to content

Commit

Permalink
de-linting
Browse files Browse the repository at this point in the history
  • Loading branch information
OrangeDog committed Jul 13, 2012
1 parent 9ca2b4d commit 31c2c3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions lib/incoming_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var util = require('./util'),
Stream = require('stream').Stream;

function IncomingForm(opts) {
if (!(this instanceof IncomingForm)) return new IncomingForm;
if (!(this instanceof IncomingForm)) return new IncomingForm(opts);
EventEmitter.call(this);

opts=opts||{};
Expand All @@ -33,6 +33,7 @@ function IncomingForm(opts) {
this._parser = null;
this._flushing = 0;
this._fieldsSize = 0;
return this;

This comment has been minimized.

Copy link
@felixge

felixge Jul 13, 2012

Why? That's implicit in JS, no?

This comment has been minimized.

Copy link
@OrangeDog

OrangeDog Jul 13, 2012

Author Owner

"function has inconsistent return points" was the warning

This comment has been minimized.

Copy link
@felixge

felixge Jul 13, 2012

"I don't give a shit" would be my reply : p. (I see the point, I just don't agree with it).

This comment has been minimized.

Copy link
@OrangeDog

OrangeDog Jul 13, 2012

Author Owner

That's cool. I'll just do the line 14 fix and remove the rest from the Pull if you want.

};
util.inherits(IncomingForm, EventEmitter);
exports.IncomingForm = IncomingForm;
Expand Down Expand Up @@ -336,7 +337,7 @@ IncomingForm.prototype._initMultipart = function(boundary) {
};

IncomingForm.prototype._fileName = function(headerValue) {
var m = headerValue.match(/filename="(.*?)"($|; )/i)
var m = headerValue.match(/filename="(.*?)"($|; )/i);
if (!m) return;

var filename = m[1].substr(m[1].lastIndexOf('\\') + 1);
Expand Down Expand Up @@ -373,7 +374,7 @@ IncomingForm.prototype._uploadPath = function(filename) {

if (this.keepExtensions) {
var ext = path.extname(filename);
ext = ext.replace(/(\.[a-z0-9]+).*/, '$1')
ext = ext.replace(/(\.[a-z0-9]+).*/, '$1');

name += ext;
}
Expand Down
8 changes: 4 additions & 4 deletions lib/multipart_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ var Buffer = require('buffer').Buffer,
PART_DATA_START: s++,
PART_DATA: s++,
PART_END: s++,
END: s++,
END: s++
},

This comment has been minimized.

Copy link
@felixge

felixge Jul 13, 2012

I like my trailing commas. They make it easier to edit and re-arrange things later.

This comment has been minimized.

Copy link
@OrangeDog

OrangeDog Jul 13, 2012

Author Owner

I like warning-free code. Feel free to put them back, I don't really mind - and it's my fault anyway for using a strict IDE.

This comment has been minimized.

Copy link
@felixge

felixge Jul 13, 2012

I also like warning free code. But I don't agree with the rules JSLint tries to enforce.

Either way, I merged it as I'd rather have the rest of your improvements (like the missing semicolons) as quick as possible : ).


f = 1,
F =
{ PART_BOUNDARY: f,
LAST_BOUNDARY: f *= 2,
LAST_BOUNDARY: f *= 2
},

LF = 10,
Expand All @@ -34,7 +34,7 @@ var Buffer = require('buffer').Buffer,
return c | 0x20;
};

for (var s in S) {
for (s in S) {
exports[s] = S[s];
}

Expand Down Expand Up @@ -207,7 +207,7 @@ MultipartParser.prototype.write = function(buffer) {
state = S.PART_DATA_START;
break;
case S.PART_DATA_START:
state = S.PART_DATA
state = S.PART_DATA;
mark('partData');
case S.PART_DATA:
prevIndex = index;
Expand Down

0 comments on commit 31c2c3f

Please sign in to comment.