test-buffer-bad-overload.js 282 B

12345678910111213141516171819
  1. 'use strict';
  2. var Buffer = require('../../').Buffer;
  3. var assert = require('assert');
  4. assert.doesNotThrow(function() {
  5. Buffer.allocUnsafe(10);
  6. });
  7. assert.throws(function() {
  8. Buffer.from(10, 'hex');
  9. });
  10. assert.doesNotThrow(function() {
  11. Buffer.from('deadbeaf', 'hex');
  12. });