Skip to content

Commit

Permalink
Node.js polyfills: Remove errorneous double call to stream.getReader(…
Browse files Browse the repository at this point in the history
…) in isByobSupported()

getReader can only be called if there isn't already another reader with
an active lock. A double call caused web browsers, which don't need the
polyfill, to mistakenly use the polyfill anyway.
  • Loading branch information
adamziel committed Jan 15, 2024
1 parent e1e7452 commit b285cb6
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/php-wasm/node-polyfills/src/lib/blob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ function isByobSupported() {
const file = new File([inputBytes], 'test');
const stream = file.stream();
try {
stream.getReader({ mode: 'byob' });
// This throws on older versions of node:
stream.getReader({ mode: 'byob' });
return true;
Expand Down

0 comments on commit b285cb6

Please sign in to comment.