Node.js commit:
https://github.com/nodejs/node/commit/
101bca988cebce584d5b6098c316a6e7bf
89b69d
These have been deprecated since Apr 27, 2013, and the plan was to
remove them in "node v0.13".
buffer.get(index) is superseded by buffer[index].
buffer.set(index, value) is superseded by buffer[index] = value.
These have never been documented at any point in node's history.
throw new TypeError('val must be string, number or Buffer')
}
-// `get` is deprecated
-Buffer.prototype.get = function get (offset) {
- console.log('.get() is deprecated. Access using array indexes instead.')
- return this.readUInt8(offset)
-}
-
-// `set` is deprecated
-Buffer.prototype.set = function set (v, offset) {
- console.log('.set() is deprecated. Access using array indexes instead.')
- return this.writeUInt8(v, offset)
-}
-
function hexWrite (buf, string, offset, length) {
offset = Number(offset) || 0
var remaining = buf.length - offset
+++ /dev/null
-if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false
-var B = require('../').Buffer
-var test = require('tape')
-
-test('.get (deprecated)', function (t) {
- var b = new B([7, 42])
- t.equal(b.get(0), 7)
- t.equal(b.get(1), 42)
- t.end()
-})
-
-test('.set (deprecated)', function (t) {
- var b = new B(2)
- b.set(7, 0)
- b.set(42, 1)
- t.equal(b[0], 7)
- t.equal(b[1], 42)
- t.end()
-})