function assertSize (size) {
if (typeof size !== 'number') {
- throw new TypeError('"size" argument must be a number')
+ throw new TypeError('"size" argument must be of type number')
} else if (size < 0) {
throw new RangeError('"size" argument must not be negative')
}
var arrayBuf = vm.runInNewContext('new ArrayBuffer()');
assert.doesNotThrow(() => Buffer.from(arrayBuf));
assert.doesNotThrow(() => Buffer.from({ buffer: arrayBuf }));
-/*
+
assert.throws(() => Buffer.alloc({ valueOf: () => 1 }),
/"size" argument must be of type number/);
assert.throws(() => Buffer.alloc({ valueOf: () => -1 }),
/"size" argument must be of type number/);
-
+/*
assert.strictEqual(Buffer.prototype.toLocaleString, Buffer.prototype.toString);
{
var buf = Buffer.from('test');