mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
buffer: graduate File from experimental and expose as global
PR-URL: https://github.com/nodejs/node/pull/47153 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
parent
202a9fa482
commit
7bc0e6a4e7
5 changed files with 18 additions and 5 deletions
|
@ -5054,10 +5054,12 @@ See [`Buffer.from(string[, encoding])`][`Buffer.from(string)`].
|
|||
added:
|
||||
- v19.2.0
|
||||
- v18.13.0
|
||||
changes:
|
||||
- version: REPLACEME
|
||||
pr-url: https://github.com/nodejs/node/pull/47153
|
||||
description: No longer experimental.
|
||||
-->
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
* Extends: {Blob}
|
||||
|
||||
A [`File`][] provides information about files.
|
||||
|
|
|
@ -474,6 +474,16 @@ changes:
|
|||
|
||||
A browser-compatible implementation of the [`fetch()`][] function.
|
||||
|
||||
## Class: `File`
|
||||
|
||||
<!-- YAML
|
||||
added: REPLACEME
|
||||
-->
|
||||
|
||||
<!-- type=global -->
|
||||
|
||||
See {File}.
|
||||
|
||||
## Class `FormData`
|
||||
|
||||
<!-- YAML
|
||||
|
|
|
@ -59,6 +59,8 @@ rules:
|
|||
message: Use `const { Event } = require('internal/event_target');` instead of the global.
|
||||
- name: EventTarget
|
||||
message: Use `const { EventTarget } = require('internal/event_target');` instead of the global.
|
||||
- name: File
|
||||
message: Use `const { File } = require('buffer');` instead of the global.
|
||||
- name: FormData
|
||||
message: Use `const { FormData } = require('internal/deps/undici/undici');` instead of the global.
|
||||
- name: Headers
|
||||
|
|
|
@ -34,6 +34,8 @@ exposeLazyInterfaces(globalThis, 'internal/worker/io', [
|
|||
defineLazyProperties(globalThis, 'buffer', ['atob', 'btoa']);
|
||||
// https://www.w3.org/TR/FileAPI/#dfn-Blob
|
||||
exposeLazyInterfaces(globalThis, 'internal/blob', ['Blob']);
|
||||
// https://www.w3.org/TR/FileAPI/#dfn-file
|
||||
exposeLazyInterfaces(globalThis, 'internal/file', ['File']);
|
||||
// https://www.w3.org/TR/hr-time-2/#the-performance-attribute
|
||||
exposeLazyInterfaces(globalThis, 'perf_hooks', [
|
||||
'Performance', 'PerformanceEntry', 'PerformanceMark', 'PerformanceMeasure',
|
||||
|
|
|
@ -13,7 +13,6 @@ const {
|
|||
|
||||
const {
|
||||
customInspectSymbol: kInspect,
|
||||
emitExperimentalWarning,
|
||||
kEnumerableProperty,
|
||||
kEmptyObject,
|
||||
toUSVString,
|
||||
|
@ -37,8 +36,6 @@ class File extends Blob {
|
|||
#lastModified;
|
||||
|
||||
constructor(fileBits, fileName, options = kEmptyObject) {
|
||||
emitExperimentalWarning('buffer.File');
|
||||
|
||||
if (arguments.length < 2) {
|
||||
throw new ERR_MISSING_ARGS('fileBits', 'fileName');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue