-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`util.isBuffer(new Buffer(4))` currently returns false with `core-util-is` and browserify 3.x. In short, `instanceof Buffer` doesn’t work to check if an object is a `Buffer` because in browserify, the Buffer constructor actually returns an instance of `Uint8Array` for performance reasons. So, by checking with `Buffer.isBuffer` instead, that gives browserify a chance to define it’s own Buffer.isBuffer implementation. I believe that in node, `Buffer.isBuffer` just does `instanceof` anyway.
- Loading branch information
Showing
2 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters