-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: BSON
-
Empty show more show less
-
Not Needed
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.