|
@ -3,7 +3,6 @@ |
|
|
|
|
|
|
|
|
const binding = process.binding('buffer'); |
|
|
const binding = process.binding('buffer'); |
|
|
const smalloc = process.binding('smalloc'); |
|
|
const smalloc = process.binding('smalloc'); |
|
|
const util = require('util'); |
|
|
|
|
|
const internalUtil = require('internal/util'); |
|
|
const internalUtil = require('internal/util'); |
|
|
const alloc = smalloc.alloc; |
|
|
const alloc = smalloc.alloc; |
|
|
const truncate = smalloc.truncate; |
|
|
const truncate = smalloc.truncate; |
|
@ -457,7 +456,7 @@ Buffer.prototype.fill = function fill(val, start, end) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// XXX remove in v0.13
|
|
|
// XXX remove in v0.13
|
|
|
Buffer.prototype.get = util.deprecate(function get(offset) { |
|
|
Buffer.prototype.get = internalUtil.deprecate(function get(offset) { |
|
|
offset = ~~offset; |
|
|
offset = ~~offset; |
|
|
if (offset < 0 || offset >= this.length) |
|
|
if (offset < 0 || offset >= this.length) |
|
|
throw new RangeError('index out of range'); |
|
|
throw new RangeError('index out of range'); |
|
@ -466,7 +465,7 @@ Buffer.prototype.get = util.deprecate(function get(offset) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// XXX remove in v0.13
|
|
|
// XXX remove in v0.13
|
|
|
Buffer.prototype.set = util.deprecate(function set(offset, v) { |
|
|
Buffer.prototype.set = internalUtil.deprecate(function set(offset, v) { |
|
|
offset = ~~offset; |
|
|
offset = ~~offset; |
|
|
if (offset < 0 || offset >= this.length) |
|
|
if (offset < 0 || offset >= this.length) |
|
|
throw new RangeError('index out of range'); |
|
|
throw new RangeError('index out of range'); |
|
|