Skip to content

Commit f6854ed

Browse files
author
debajit.roy
committed
Uses for in to assign properties instead of Object.assign
1 parent dc171c3 commit f6854ed

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/form_data.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ util.inherits(FormData, CombinedStream);
2121
* and file uploads to other web applications.
2222
*
2323
* @constructor
24+
* @param {Object} options - Properties to be added/overriden for FormData and CombinedStream
2425
*/
2526
function FormData(options) {
2627
if (!(this instanceof FormData)) {
@@ -31,7 +32,12 @@ function FormData(options) {
3132
this._valueLength = 0;
3233
this._valuesToMeasure = [];
3334

34-
Object.assign(this, CombinedStream.create(options));
35+
CombinedStream.call(this);
36+
37+
options = options || {};
38+
for (var option in options) {
39+
this[option] = options[option];
40+
}
3541
}
3642

3743
FormData.LINE_BREAK = '\r\n';

0 commit comments

Comments
 (0)