Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wpts on node v18.13.0+ #1859

Merged
merged 1 commit into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/fetch/formdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ function makeEntry (name, value, filename) {
lastModified: value.lastModified
}

value = value instanceof File
value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
? new File([value], filename, options)
: new FileLike(value, filename, options)
}
Expand Down
3 changes: 2 additions & 1 deletion test/wpt/runner/runner/worker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { join } from 'node:path'
import { runInThisContext } from 'node:vm'
import { parentPort, workerData } from 'node:worker_threads'
import { readFileSync } from 'node:fs'
import buffer from 'node:buffer'
import {
setGlobalOrigin,
Response,
Expand Down Expand Up @@ -34,7 +35,7 @@ Object.defineProperties(globalThis, {
},
File: {
...globalPropertyDescriptors,
value: File
value: buffer.File ?? File
},
FormData: {
...globalPropertyDescriptors,
Expand Down
2 changes: 1 addition & 1 deletion test/wpt/status/FileAPI.status.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"File-constructor.any.js": {
"fail": [
"flaky": [
"Using type in File constructor: nonparsable"
]
},
Expand Down