mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 20:08:02 +00:00

It is a maintenance burden that was removed from the docs in 2010 (c93e0aaf06
) and runtime-deprecated in v6.0 (1124de2d76
). PR-URL: https://github.com/nodejs/node/pull/9683 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
22 lines
575 B
JavaScript
22 lines
575 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const path = require('path');
|
|
const fs = require('fs');
|
|
const filepath = path.join(common.fixturesDir, 'x.txt');
|
|
const fd = fs.openSync(filepath, 'r');
|
|
const expected = 'xyz\n';
|
|
|
|
// Error must be thrown with string
|
|
assert.throws(() => {
|
|
fs.read(fd,
|
|
expected.length,
|
|
0,
|
|
'utf-8',
|
|
() => {});
|
|
}, /Second argument needs to be a buffer/);
|
|
|
|
assert.throws(() => {
|
|
fs.readSync(fd, expected.length, 0, 'utf-8');
|
|
}, /Second argument needs to be a buffer/);
|