diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-02-14 23:42:57 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-03-02 02:09:24 +0000 |
commit | 177b7314cf62f6c268eef9f71657aba9c93385ed (patch) | |
tree | a10e1645ca85ae1a9088280d41f6649bb7659433 /doc | |
parent | d3af120f7ae0210ad1b5cc751df10138ea4a4e43 (diff) | |
download | android-node-v8-177b7314cf62f6c268eef9f71657aba9c93385ed.tar.gz android-node-v8-177b7314cf62f6c268eef9f71657aba9c93385ed.tar.bz2 android-node-v8-177b7314cf62f6c268eef9f71657aba9c93385ed.zip |
buffer: improve Buffer#fill performance
1) This improves the performance for Buffer#fill by using shortcuts.
2) It also ports throwing errors to JS. That way they contain the
proper error code.
3) Using negative `end` values will from now on result in an error
instead of just doing nothing.
4) Passing in `null` as encoding is from now on accepted as 'utf8'.
PR-URL: https://github.com/nodejs/node/pull/18790
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/buffer.md | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 225726316a..510848c3b0 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -1203,6 +1203,9 @@ console.log(buf1.equals(buf3)); added: v0.5.0 changes: - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/18790 + description: Negative `end` values throw an `ERR_INDEX_OUT_OF_RANGE` error. + - version: REPLACEME pr-url: https://github.com/nodejs/node/pull/18129 description: Attempting to fill a non-zero length buffer with a zero length buffer triggers a thrown exception. |