-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fs: remove fs.read's string interface
It is a maintenance burden that was removed from the docs in 2010 (c93e0aa) and runtime-deprecated in v6.0 (1124de2). PR-URL: #9683 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
- Loading branch information
Showing
7 changed files
with
57 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'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/); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters