-
-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate proper instanceof Buffer
support
#40
Comments
Unfortunately, the delete statement there usually does nothing, as all of the properties exist deeper in the prototype chain. It's literally just there for the case that there is one. From MDN:
function Foo(){}
Foo.prototype.bar = 42;
var foo = new Foo();
// returns true, but with no effect,
// since bar is an inherited property
delete foo.bar; |
I pushed an attempt to fix |
The |
New possible solution: nodejs/node#106 (comment) |
This fixes the last remaining incompatibility with the node Buffer! And since Buffer in node v4.0.0 is based on There's a 50% performance hit on the 16 byte buffer test ( |
@feross any reason why |
Well, they do a bunch of calls directly into C++. I think one reason they do that is so they can disable the behavior where new typed array memory must be zeroed-out for security reasons in the browser environment. In node, they can do without that and get perf improvements. Maybe there are more reasons... |
I saw a potential way to get
instanceof Buffer
working in a module by @dcodeIO: https://github.com/dcodeIO/node-BufferView/blob/master/BufferView.jsThe text was updated successfully, but these errors were encountered: