diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-02-09 00:54:31 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-02-26 23:18:12 +0000 |
commit | e9f2cecf1a14285574f9b6104dd690ef92495d74 (patch) | |
tree | 6160626254f229aceff338614f71a2091a55e485 /doc | |
parent | 009e41826f47c595ca994f673023f9380198be36 (diff) | |
download | android-node-v8-e9f2cecf1a14285574f9b6104dd690ef92495d74.tar.gz android-node-v8-e9f2cecf1a14285574f9b6104dd690ef92495d74.tar.bz2 android-node-v8-e9f2cecf1a14285574f9b6104dd690ef92495d74.zip |
Revert "fs: Revert throw on invalid callbacks"
This reverts commit 8250bfd1e5188d5dada58aedf7a991e959d5eaa9.
PR-URL: https://github.com/nodejs/node/pull/18668
Refs: https://github.com/nodejs/node/pull/12562
Refs: https://github.com/nodejs/node/pull/12976
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/deprecations.md | 5 | ||||
-rw-r--r-- | doc/api/fs.md | 180 |
2 files changed, 153 insertions, 32 deletions
diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 8b38a7863c..651e5d1cf9 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -162,9 +162,10 @@ explicitly via error event handlers set on the domain instead. <a id="DEP0013"></a> ### DEP0013: fs asynchronous function without callback -Type: Runtime +Type: End-of-Life -Calling an asynchronous function without a callback is deprecated. +Calling an asynchronous function without a callback throws a `TypeError` +REPLACEME onwards. Refer: [PR 12562](https://github.com/nodejs/node/pull/12562) <a id="DEP0014"></a> ### DEP0014: fs.read legacy String interface diff --git a/doc/api/fs.md b/doc/api/fs.md index e5ffae410a..f33bbe4785 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -819,10 +819,14 @@ try { <!-- YAML added: v0.6.7 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7831 description: The passed `options` object will never be modified. @@ -935,6 +939,10 @@ try { <!-- YAML added: v0.1.30 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.6.0 pr-url: https://github.com/nodejs/node/pull/10739 description: The `path` parameter can be a WHATWG `URL` object using `file:` @@ -942,7 +950,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `path` {string|Buffer|URL} @@ -1018,6 +1026,10 @@ See also: chmod(2) <!-- YAML added: v0.1.97 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.6.0 pr-url: https://github.com/nodejs/node/pull/10739 description: The `path` parameter can be a WHATWG `URL` object using `file:` @@ -1025,7 +1037,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `path` {string|Buffer|URL} @@ -1062,10 +1074,14 @@ See also: chown(2) <!-- YAML added: v0.0.2 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `fd` {integer} @@ -1444,10 +1460,14 @@ a callback.) <!-- YAML added: v0.4.7 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `fd` {integer} @@ -1472,10 +1492,14 @@ Synchronous fchmod(2). Returns `undefined`. <!-- YAML added: v0.4.7 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `fd` {integer} @@ -1502,10 +1526,14 @@ Synchronous fchown(2). Returns `undefined`. <!-- YAML added: v0.1.96 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `fd` {integer} @@ -1528,10 +1556,14 @@ Synchronous fdatasync(2). Returns `undefined`. <!-- YAML added: v0.1.95 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `fd` {integer} @@ -1557,10 +1589,14 @@ Synchronous fstat(2). Returns an instance of [`fs.Stats`][]. <!-- YAML added: v0.1.96 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `fd` {integer} @@ -1583,10 +1619,14 @@ Synchronous fsync(2). Returns `undefined`. <!-- YAML added: v0.8.6 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `fd` {integer} @@ -1652,10 +1692,14 @@ Synchronous ftruncate(2). Returns `undefined`. <!-- YAML added: v0.4.2 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. - version: v4.1.0 pr-url: https://github.com/nodejs/node/pull/2387 description: Numeric strings, `NaN` and `Infinity` are now allowed @@ -1694,10 +1738,14 @@ Synchronous version of [`fs.futimes()`][]. Returns `undefined`. <!-- YAML deprecated: v0.4.7 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `path` {string|Buffer|URL} @@ -1724,10 +1772,14 @@ Synchronous lchmod(2). Returns `undefined`. <!-- YAML deprecated: v0.4.7 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `path` {string|Buffer|URL} @@ -1754,6 +1806,10 @@ Synchronous lchown(2). Returns `undefined`. <!-- YAML added: v0.1.31 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.6.0 pr-url: https://github.com/nodejs/node/pull/10739 description: The `existingPath` and `newPath` parameters can be WHATWG @@ -1762,7 +1818,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `existingPath` {string|Buffer|URL} @@ -1793,6 +1849,10 @@ Synchronous link(2). Returns `undefined`. <!-- YAML added: v0.1.30 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.6.0 pr-url: https://github.com/nodejs/node/pull/10739 description: The `path` parameter can be a WHATWG `URL` object using `file:` @@ -1800,7 +1860,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `path` {string|Buffer|URL} @@ -1832,6 +1892,10 @@ Synchronous lstat(2). Returns an instance of [`fs.Stats`][]. <!-- YAML added: v0.1.8 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.6.0 pr-url: https://github.com/nodejs/node/pull/10739 description: The `path` parameter can be a WHATWG `URL` object using `file:` @@ -1839,7 +1903,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `path` {string|Buffer|URL} @@ -1874,10 +1938,14 @@ See also: mkdir(2) <!-- YAML added: v5.10.0 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. - version: v6.2.1 pr-url: https://github.com/nodejs/node/pull/6828 description: The `callback` parameter is optional now. @@ -2130,6 +2198,10 @@ a Promise for an object with `bytesRead` and `buffer` properties. <!-- YAML added: v0.1.8 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.6.0 pr-url: https://github.com/nodejs/node/pull/10739 description: The `path` parameter can be a WHATWG `URL` object using `file:` @@ -2137,7 +2209,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. - version: v6.0.0 pr-url: https://github.com/nodejs/node/pull/5616 description: The `options` parameter was added. @@ -2186,6 +2258,10 @@ the filenames returned will be passed as `Buffer` objects. <!-- YAML added: v0.1.29 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.6.0 pr-url: https://github.com/nodejs/node/pull/10739 description: The `path` parameter can be a WHATWG `URL` object using `file:` @@ -2193,7 +2269,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. - version: v5.1.0 pr-url: https://github.com/nodejs/node/pull/3740 description: The `callback` will always be called with `null` as the `error` @@ -2296,6 +2372,10 @@ fs.readFileSync('<directory>'); // => null, <data> <!-- YAML added: v0.1.31 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.6.0 pr-url: https://github.com/nodejs/node/pull/10739 description: The `path` parameter can be a WHATWG `URL` object using `file:` @@ -2303,7 +2383,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `path` {string|Buffer|URL} @@ -2365,6 +2445,10 @@ Synchronous version of [`fs.read()`][]. Returns the number of `bytesRead`. <!-- YAML added: v0.1.31 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v8.0.0 pr-url: https://github.com/nodejs/node/pull/13028 description: Pipe/Socket resolve support was added. @@ -2375,7 +2459,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. - version: v6.4.0 pr-url: https://github.com/nodejs/node/pull/7899 description: Calling `realpath` now works again for various edge cases @@ -2518,6 +2602,10 @@ this restriction. <!-- YAML added: v0.0.2 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.6.0 pr-url: https://github.com/nodejs/node/pull/10739 description: The `oldPath` and `newPath` parameters can be WHATWG `URL` @@ -2526,7 +2614,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `oldPath` {string|Buffer|URL} @@ -2557,6 +2645,10 @@ Synchronous rename(2). Returns `undefined`. <!-- YAML added: v0.0.2 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.6.0 pr-url: https://github.com/nodejs/node/pull/10739 description: The `path` parameters can be a WHATWG `URL` object using @@ -2564,7 +2656,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `path` {string|Buffer|URL} @@ -2598,6 +2690,10 @@ on Windows and an `ENOTDIR` error on POSIX. <!-- YAML added: v0.0.2 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.6.0 pr-url: https://github.com/nodejs/node/pull/10739 description: The `path` parameter can be a WHATWG `URL` object using `file:` @@ -2605,7 +2701,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `path` {string|Buffer|URL} @@ -2694,10 +2790,14 @@ Synchronous symlink(2). Returns `undefined`. <!-- YAML added: v0.8.6 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `path` {string|Buffer|URL} @@ -2730,6 +2830,10 @@ in the future. <!-- YAML added: v0.0.2 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.6.0 pr-url: https://github.com/nodejs/node/pull/10739 description: The `path` parameter can be a WHATWG `URL` object using `file:` @@ -2737,7 +2841,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `path` {string|Buffer|URL} @@ -2798,6 +2902,10 @@ and `fs.unwatchFile()` when possible. <!-- YAML added: v0.4.2 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v8.0.0 pr-url: https://github.com/nodejs/node/pull/11919 description: "`NaN`, `Infinity`, and `-Infinity` are no longer valid time @@ -2809,7 +2917,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. - version: v4.1.0 pr-url: https://github.com/nodejs/node/pull/2387 description: Numeric strings, `NaN` and `Infinity` are now allowed @@ -3031,6 +3139,10 @@ This happens when: <!-- YAML added: v0.0.2 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.4.0 pr-url: https://github.com/nodejs/node/pull/10382 description: The `buffer` parameter can now be a `Uint8Array`. @@ -3040,7 +3152,7 @@ changes: - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `fd` {integer} @@ -3080,13 +3192,17 @@ the end of the file. <!-- YAML added: v0.11.5 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.2.0 pr-url: https://github.com/nodejs/node/pull/7856 description: The `position` parameter is optional now. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. --> * `fd` {integer} @@ -3127,13 +3243,17 @@ the end of the file. <!-- YAML added: v0.1.29 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/12562 + description: The `callback` parameter is no longer optional. Not passing + it will throw a `TypeError` at runtime. - version: v7.4.0 pr-url: https://github.com/nodejs/node/pull/10382 description: The `data` parameter can now be a `Uint8Array`. - version: v7.0.0 pr-url: https://github.com/nodejs/node/pull/7897 description: The `callback` parameter is no longer optional. Not passing - it will emit a deprecation warning. + it will emit a deprecation warning with id DEP0013. - version: v5.0.0 pr-url: https://github.com/nodejs/node/pull/3163 description: The `file` parameter can be a file descriptor now. |