Skip to content

Commit 02affc8

Browse files
committed
buffer: expose Blob as a global
`Blob` is defined as a global in the spec. We have WPT's for it, and it's graduated experimental. Time to expose it as a global. Signed-off-by: James M Snell <[email protected]>
1 parent a7bc0c9 commit 02affc8

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

doc/api/globals.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,16 @@ added: v17.3.0
199199

200200
If `abortSignal.aborted` is `true`, throws `abortSignal.reason`.
201201

202+
## Class: `Blob`
203+
204+
<!-- YAML
205+
added: REPLACEME
206+
-->
207+
208+
<!-- type=global -->
209+
210+
See {Blob}.
211+
202212
## Class: `Buffer`
203213

204214
<!-- YAML

lib/internal/bootstrap/node.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ function setupGlobalProxy() {
444444

445445
function setupBuffer() {
446446
const {
447+
Blob,
447448
Buffer,
448449
atob,
449450
btoa,
@@ -456,6 +457,12 @@ function setupBuffer() {
456457
delete bufferBinding.zeroFill;
457458

458459
ObjectDefineProperties(globalThis, {
460+
'Blob': {
461+
value: Blob,
462+
enumerable: false,
463+
writable: true,
464+
configurable: true,
465+
},
459466
'Buffer': {
460467
value: Buffer,
461468
enumerable: false,

0 commit comments

Comments
 (0)