Skip to content

Commit

Permalink
buffer: clean up usage of __proto__
Browse files Browse the repository at this point in the history
Prefer using Object.setPrototypeOf() instead.

PR-URL: #3080
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
trevnorris committed Oct 6, 2015
1 parent a1bda1b commit 8a685e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ function Buffer(arg) {
return fromObject(arg);
}

Buffer.prototype.__proto__ = Uint8Array.prototype;
Buffer.__proto__ = Uint8Array;
Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype);
Object.setPrototypeOf(Buffer, Uint8Array);


function SlowBuffer(length) {
Expand All @@ -72,8 +72,8 @@ function SlowBuffer(length) {
return ui8;
}

SlowBuffer.prototype.__proto__ = Buffer.prototype;
SlowBuffer.__proto__ = Buffer;
Object.setPrototypeOf(SlowBuffer.prototype, Uint8Array.prototype);
Object.setPrototypeOf(SlowBuffer, Uint8Array);


function allocate(size) {
Expand Down

0 comments on commit 8a685e7

Please sign in to comment.