Skip to content

Commit c399fdf

Browse files
tsctxKhafraDev
andauthored
fix formdata constructor args mark optional (#4411)
* fix formdata constructor args mark optional * fixup * Update test/fetch/formdata.js Co-authored-by: Khafra <maitken033380023@gmail.com> --------- Co-authored-by: Khafra <maitken033380023@gmail.com>
1 parent c1442a4 commit c399fdf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/web/fetch/formdata.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const nodeUtil = require('node:util')
99
class FormData {
1010
#state = []
1111

12-
constructor (form) {
12+
constructor (form = undefined) {
1313
webidl.util.markAsUncloneable(this)
1414

1515
if (form !== undefined) {

test/fetch/formdata.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ test('FormData should be compatible with third-party libraries', (t) => {
341341
})
342342

343343
test('arguments', () => {
344-
assert.strictEqual(FormData.constructor.length, 1)
344+
assert.strictEqual(FormData.length, 0)
345345
assert.strictEqual(FormData.prototype.append.length, 2)
346346
assert.strictEqual(FormData.prototype.delete.length, 1)
347347
assert.strictEqual(FormData.prototype.get.length, 1)

0 commit comments

Comments
 (0)