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 <[email protected]>
  • Loading branch information
trevnorris authored and jasnell committed Oct 8, 2015
1 parent e0fffca commit d5a1b1a
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 d5a1b1a

Please sign in to comment.