Skip to content

Commit 67b8a8e

Browse files
committed
toString should output '[object FormData]'
1 parent 03444d2 commit 67b8a8e

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

lib/form_data.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,3 +438,7 @@ FormData.prototype._error = function(err) {
438438
this.emit('error', err);
439439
}
440440
};
441+
442+
FormData.prototype.toString = function () {
443+
return '[object FormData]';
444+
};

test/integration/test-to-string.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var common = require('../common');
2+
var assert = common.assert;
3+
var FormData = require(common.dir.lib + '/form_data');
4+
5+
assert(new FormData().toString() === '[object FormData]');

0 commit comments

Comments
 (0)