mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
buffer: fix cyclic dependency with util
PR-URL: https://github.com/nodejs/io.js/pull/1988 Fixes: https://github.com/nodejs/io.js/issues/1987 Reviewed-By: Roman Reiss <me@silverwind.io>
This commit is contained in:
parent
1d79f572f1
commit
d5637e67c9
2 changed files with 6 additions and 3 deletions
|
@ -3,7 +3,6 @@
|
|||
|
||||
const binding = process.binding('buffer');
|
||||
const smalloc = process.binding('smalloc');
|
||||
const util = require('util');
|
||||
const internalUtil = require('internal/util');
|
||||
const alloc = smalloc.alloc;
|
||||
const truncate = smalloc.truncate;
|
||||
|
@ -457,7 +456,7 @@ Buffer.prototype.fill = function fill(val, start, end) {
|
|||
|
||||
|
||||
// XXX remove in v0.13
|
||||
Buffer.prototype.get = util.deprecate(function get(offset) {
|
||||
Buffer.prototype.get = internalUtil.deprecate(function get(offset) {
|
||||
offset = ~~offset;
|
||||
if (offset < 0 || offset >= this.length)
|
||||
throw new RangeError('index out of range');
|
||||
|
@ -466,7 +465,7 @@ Buffer.prototype.get = util.deprecate(function get(offset) {
|
|||
|
||||
|
||||
// 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;
|
||||
if (offset < 0 || offset >= this.length)
|
||||
throw new RangeError('index out of range');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue