Skip to content
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
6 changes: 4 additions & 2 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions doc/api/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/internal/bootstrap/web/exposed-window-or-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 0 additions & 3 deletions lib/internal/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const {

const {
customInspectSymbol: kInspect,
emitExperimentalWarning,
kEnumerableProperty,
kEmptyObject,
toUSVString,
Expand All @@ -38,8 +37,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');
}
Expand Down