diff options
author | 2022-08-18 21:14:52 -0700 | |
---|---|---|
committer | 2022-08-18 21:14:52 -0700 | |
commit | 922c361f6a6a4ef165fe7d61ed6da14f89324fe0 (patch) | |
tree | c57ddf3d64a8c7f44e4c34e1e163b04f630f671e /src/bun.js/builtins/js | |
parent | 0e4db0b28fb73b0db45bf727e295def014dd691e (diff) | |
download | bun-922c361f6a6a4ef165fe7d61ed6da14f89324fe0.tar.gz bun-922c361f6a6a4ef165fe7d61ed6da14f89324fe0.tar.zst bun-922c361f6a6a4ef165fe7d61ed6da14f89324fe0.zip |
un-delete some code
Diffstat (limited to 'src/bun.js/builtins/js')
-rw-r--r-- | src/bun.js/builtins/js/JSBufferPrototype.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/bun.js/builtins/js/JSBufferPrototype.js b/src/bun.js/builtins/js/JSBufferPrototype.js index de80450b1..310870540 100644 --- a/src/bun.js/builtins/js/JSBufferPrototype.js +++ b/src/bun.js/builtins/js/JSBufferPrototype.js @@ -284,6 +284,17 @@ function subarray(start, end) { return new Buffer(this.buffer, this.byteOffset + (start || 0), (end || this.byteLength) - (start || 0)); } +function slice(start, end) { + "use strict"; + if (start === undefined && end === undefined) { + return this; + } + + Buffer[Symbol.species] ||= Buffer; + + return new Buffer(this.buffer, this.byteOffset + (start || 0), (end || this.byteLength) - (start || 0)); +} + function initializeBunBuffer(parameters) { |