Skip to content

Commit

Permalink
buffer: expose Blob as a global
Browse files Browse the repository at this point in the history
`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]>
  • Loading branch information
jasnell committed Dec 21, 2021
1 parent a7bc0c9 commit f9053bb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ function setupGlobalProxy() {

function setupBuffer() {
const {
Blob,
Buffer,
atob,
btoa,
Expand All @@ -456,6 +457,12 @@ function setupBuffer() {
delete bufferBinding.zeroFill;

ObjectDefineProperties(globalThis, {
'Blob': {
value: Blob,
enumerable: false,
writable: true,
configurable: true,
},
'Buffer': {
value: Buffer,
enumerable: false,
Expand Down

0 comments on commit f9053bb

Please sign in to comment.