-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve ArrayBuffer brand check in ensureBuffer (#429)
`instanceof` is notoriously unreliable in JS, because it can be fooled by prototype manipulation and breaks down entirely for cross-realm brand checks. Using `Object.prototype.toString` is generally a better choice for this. This also adds `SharedArrayBuffer` as an alternative, as both should be treated the same under most circumstances.
- Loading branch information
Showing
2 changed files
with
35 additions
and
2 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