Skip to content

Commit

Permalink
Add similar type error as the browser for attempting to use form-data…
Browse files Browse the repository at this point in the history
… without new.
  • Loading branch information
DylanPiercey committed Jul 23, 2015
1 parent 7200b2c commit 5711320
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/form_data.js
Expand Up @@ -10,6 +10,10 @@ var async = require('async');

module.exports = FormData;
function FormData() {
if (!(this instanceof FormData)) {
throw new TypeError("Failed to construct 'FormData': Please use the 'new' operator, this object constructor cannot be called as a function.")
}

this._overheadLength = 0;
this._valueLength = 0;
this._lengthRetrievers = [];
Expand Down

0 comments on commit 5711320

Please sign in to comment.