您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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