Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
lib,buffer: temp workaround chakra bug
Browse files Browse the repository at this point in the history
Reviewed-by: @kunalspathak
  • Loading branch information
Jianchun Xu committed Sep 21, 2015
1 parent 3a55f98 commit e4207e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,10 @@ Buffer.prototype.toJSON = function() {
// TODO(trevnorris): currently works like Array.prototype.slice(), which
// doesn't follow the new standard for throwing on out of range indexes.
Buffer.prototype.slice = function slice(start, end) {
const buffer = this.subarray(start, end);
//const buffer = this.subarray(start, end);
const buffer = (end !== undefined ?
this.subarray(start, end) : this.subarray(start));
// CHAKRA-TODO: Remove above bug work around!
Object.setPrototypeOf(buffer, Buffer.prototype);
return buffer;
};
Expand Down

0 comments on commit e4207e2

Please sign in to comment.