}
}
+Object.defineProperty(Buffer.prototype, 'offset', {
+ enumerable: true,
+ get () {
+ if (!(this instanceof Buffer)) {
+ return undefined
+ }
+ return this.byteOffset
+ }
+})
+
function createBuffer (length) {
if (length > K_MAX_LENGTH) {
throw new RangeError('Invalid typed array length')
var b = Buffer.alloc(128);
assert.strictEqual(128, b.length);
assert.strictEqual(0, b.byteOffset);
- //assert.strictEqual(0, b.offset);
+ assert.strictEqual(0, b.offset);
}
// Test creating a Buffer from a Uint32Array