| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent fe66d2b commit ec0d623
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -319,6 +319,7 @@ module.exports = { | |||
| 319 | 319 | Crypto: 'readable', | |
| 320 | 320 | CryptoKey: 'readable', | |
| 321 | 321 | fetch: 'readable', | |
| 322 | + FormData: 'readable', | ||
| 322 | 323 | globalThis: 'readable', | |
| 323 | 324 | Response: 'readable', | |
| 324 | 325 | SubtleCrypto: 'readable', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -363,6 +363,17 @@ added: v17.5.0 | |||
| 363 | 363 | ||
| 364 | 364 | A browser-compatible implementation of the [`fetch()`][] function. | |
| 365 | 365 | ||
| 366 | + ## Class `FormData` | ||
| 367 | + | ||
| 368 | + <!-- YAML | ||
| 369 | + added: REPLACEME | ||
| 370 | + --> | ||
| 371 | + | ||
| 372 | + > Stability: 1 - Experimental. Enable this API with the [`--experimental-fetch`][] | ||
| 373 | + > CLI flag. | ||
| 374 | + | ||
| 375 | + A browser-compatible implementation of {FormData}. | ||
| 376 | + | ||
| 366 | 377 | ## `global` | |
| 367 | 378 | ||
| 368 | 379 | <!-- YAML | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,6 +47,8 @@ rules: | |||
| 47 | 47 | message: Use `const { Event } = require('internal/event_target');` instead of the global. | |
| 48 | 48 | - name: EventTarget | |
| 49 | 49 | message: Use `const { EventTarget } = require('internal/event_target');` instead of the global. | |
| 50 | + - name: FormData | ||
| 51 | + message: Use `const { FormData } = require('internal/deps/undici/undici');` instead of the global. | ||
| 50 | 52 | - name: Headers | |
| 51 | 53 | message: Use `const { Headers } = require('internal/deps/undici/undici');` instead of the global. | |
| 52 | 54 | # Intl is not available in primordials because it can be | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -163,6 +163,12 @@ function setupFetch() { | |||
| 163 | 163 | configurable: true, | |
| 164 | 164 | value: undici.fetch | |
| 165 | 165 | }); | |
| 166 | + ObjectDefineProperty(globalThis, 'FormData', { | ||
| 167 | + writable: true, | ||
| 168 | + enumerable: false, | ||
| 169 | + configurable: true, | ||
| 170 | + value: undici.FormData | ||
| 171 | + }); | ||
| 166 | 172 | ObjectDefineProperty(globalThis, 'Headers', { | |
| 167 | 173 | writable: true, | |
| 168 | 174 | enumerable: false, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -303,6 +303,7 @@ if (global.structuredClone) { | |||
| 303 | 303 | if (global.fetch) { | |
| 304 | 304 | knownGlobals.push( | |
| 305 | 305 | global.fetch, | |
| 306 | + global.FormData, | ||
| 306 | 307 | global.Request, | |
| 307 | 308 | global.Response, | |
| 308 | 309 | global.Headers, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,6 +7,7 @@ import events from 'events'; | |||
| 7 | 7 | import http from 'http'; | |
| 8 | 8 | ||
| 9 | 9 | assert.strictEqual(typeof globalThis.fetch, 'function'); | |
| 10 | + assert.strictEqual(typeof globalThis.FormData, 'function'); | ||
| 10 | 11 | assert.strictEqual(typeof globalThis.Headers, 'function'); | |
| 11 | 12 | assert.strictEqual(typeof globalThis.Request, 'function'); | |
| 12 | 13 | assert.strictEqual(typeof globalThis.Response, 'function'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ runner.setScriptModifier((obj) => { | |||
| 11 | 11 | // created via `document.createElement`. So we need to ignore them and just | |
| 12 | 12 | // test `URL`. | |
| 13 | 13 | obj.code = obj.code.replace(/\["url", "a", "area"\]/, '[ "url" ]'); | |
| 14 | - } else if (typeof FormData === 'undefined' && // eslint-disable-line | ||
| 14 | + } else if (typeof FormData === 'undefined' && | ||
| 15 | 15 | obj.filename.includes('urlsearchparams-constructor.any.js')) { | |
| 16 | 16 | // TODO(XadillaX): Remove this `else if` after `FormData` is supported. | |
| 17 | 17 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -271,6 +271,7 @@ const customTypesMap = { | |||
| 271 | 271 | 'TextDecoderStream': | |
| 272 | 272 | 'webstreams.md#class-textdecoderstream', | |
| 273 | 273 | ||
| 274 | + 'FormData': 'https://developer.mozilla.org/en-US/docs/Web/API/FormData', | ||
| 274 | 275 | 'Headers': 'https://developer.mozilla.org/en-US/docs/Web/API/Headers', | |
| 275 | 276 | 'Response': 'https://developer.mozilla.org/en-US/docs/Web/API/Response', | |
| 276 | 277 | 'Request': 'https://developer.mozilla.org/en-US/docs/Web/API/Request', | |
| Back | FazBrowse Home | New Git URL |
0 commit comments