Permalink
Browse files

Formatting for consistency.

  • Loading branch information...
1 parent 184354f commit e095ad906ff5f36c7cf7e7752369ef0d39ae1010 @PlNG committed Oct 28, 2011
Showing with 22 additions and 21 deletions.
  1. +22 −21 lib/querystring_parser.js
View
@@ -1,25 +1,26 @@
-if (global.GENTLY) require = GENTLY.hijack(require);
-
-// This is a buffering parser, not quite as nice as the multipart one.
-// If I find time I'll rewrite this to be fully streaming as well
-var querystring = require('querystring');
-
+if (global.GENTLY) {
+ require = GENTLY.hijack(require);
+}
+var querystring = require("querystring");
function QuerystringParser() {
- this.buffer = '';
-};
+ "use strict";
+ this.buffer = "";
+}
exports.QuerystringParser = QuerystringParser;
-
-QuerystringParser.prototype.write = function(buffer) {
- this.buffer += buffer.toString('ascii');
- return buffer.length;
+QuerystringParser.prototype.write = function (buffer) {
+ "use strict";
+ this.buffer += buffer.toString("ascii");
+ return buffer.length;
};
-
-QuerystringParser.prototype.end = function() {
- var fields = querystring.parse(this.buffer);
- for (var field in fields) {
- this.onField(field, fields[field]);
- }
- this.buffer = '';
-
- this.onEnd();
+QuerystringParser.prototype.end = function () {
+ "use strict";
+ var field,
+ fields = querystring.parse(this.buffer);
+ for (field in fields) {
+ if (fields.hasOwnProperty(field)) {
+ this.onField(field, fields[field]);
+ }
+ }
+ this.buffer = "";
+ this.onEnd();
};

0 comments on commit e095ad9

Please sign in to comment.