You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test-buffer-bad-overload.js 282B

123456789101112131415161718
  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. });