Skip to content

Commit 8fc5cf7

Browse files
committed
fixup
1 parent f1e2091 commit 8fc5cf7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/fetch/formdata.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ class FormData {
2525
throw new TypeError('Failed to execute \'append\' on \'FormData\': parameter 2 is not of type \'Blob\'')
2626
}
2727
const name = String(args[0])
28-
const value = args[1] instanceof Blob ? args[1] : String(args[1])
2928
const filename = args.length === 3 ? String(args[2]) : undefined
3029

3130
// 1. Let value be value if given; otherwise blobValue.
31+
const value = args[1] instanceof Blob ? args[1] : String(args[1])
32+
3233
// 2. Let entry be the result of creating an entry with
3334
// name, value, and filename if given.
3435
const entry = makeEntry(name, value, filename)
@@ -122,13 +123,14 @@ class FormData {
122123
throw new TypeError('Failed to execute \'set\' on \'FormData\': parameter 2 is not of type \'Blob\'')
123124
}
124125
const name = String(args[0])
125-
const value = args[1] instanceof Blob ? args[1] : String(args[1])
126126
const filename = args.length === 3 ? String(args[2]) : undefined
127127

128128
// The set(name, value) and set(name, blobValue, filename) method steps
129129
// are:
130130

131131
// 1. Let value be value if given; otherwise blobValue.
132+
const value = args[1] instanceof Blob ? args[1] : String(args[1])
133+
132134
// 2. Let entry be the result of creating an entry with name, value, and
133135
// filename if given.
134136
const entry = makeEntry(name, value, filename)

0 commit comments

Comments
 (0)