Sha256: 767c5c288d17ed2cb1b44c1ab6f82407db10f39e39e76f8926e01d06826f8b85

Contents?: true

Size: 1.09 KB

Versions: 23

Compression:

Stored size: 1.09 KB

Contents

/* */ 
(function(process) {
  'use strict';
  var Buffer = require("../../index").Buffer;
  if (process.env.OBJECT_IMPL)
    Buffer.TYPED_ARRAY_SUPPORT = false;
  var common = {};
  var assert = require("assert");
  var Buffer = require("../../index").Buffer;
  var LENGTH = 16;
  var ab = new ArrayBuffer(LENGTH);
  var dv = new DataView(ab);
  var ui = new Uint8Array(ab);
  var buf = new Buffer(ab);
  assert.ok(Buffer.isBuffer(buf));
  assert.equal(buf.parent, undefined);
  assert.equal(buf.buffer, ab);
  assert.equal(buf.length, ab.byteLength);
  buf.fill(0xC);
  for (var i = 0; i < LENGTH; i++) {
    assert.equal(ui[i], 0xC);
    ui[i] = 0xF;
    assert.equal(buf[i], 0xF);
  }
  buf.writeUInt32LE(0xF00, 0);
  buf.writeUInt32BE(0xB47, 4);
  buf.writeDoubleLE(3.1415, 8);
  assert.equal(dv.getUint32(0, true), 0xF00);
  assert.equal(dv.getUint32(4), 0xB47);
  assert.equal(dv.getFloat64(8, true), 3.1415);
  assert.throws(function() {
    function AB() {}
    AB.__proto__ = ArrayBuffer;
    AB.prototype.__proto__ = ArrayBuffer.prototype;
    new Buffer(new AB());
  }, TypeError);
})(require("process"));

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
sequenceserver-2.0.0 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-2.0.0.rc8 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-2.0.0.rc7 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-2.0.0.rc6 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-2.0.0.rc5 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-2.0.0.rc4 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-2.0.0.rc3 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-2.0.0.rc2 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-2.0.0.rc1 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-2.0.0.beta4 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-2.0.0.beta3 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-2.0.0.beta1 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-1.1.0.beta12 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-1.1.0.beta11 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-1.1.0.beta10 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-1.1.0.beta8 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-1.1.0.beta7 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-1.1.0.beta6 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-1.1.0.beta5 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js
sequenceserver-1.1.0.beta4 public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js